Lines Matching refs:ctx
26 explicit AssertOp(OpKernelConstruction* ctx) : OpKernel(ctx) {
27 OP_REQUIRES_OK(ctx, ctx->GetAttr("summarize", &summarize_));
30 void Compute(OpKernelContext* ctx) override {
31 const Tensor& cond = ctx->input(0);
32 OP_REQUIRES(ctx, IsLegacyScalar(cond.shape()),
40 for (int i = 1; i < ctx->num_inputs(); ++i) {
41 strings::StrAppend(&msg, "[", ctx->input(i).SummarizeValue(summarize_),
43 if (i < ctx->num_inputs() - 1) strings::StrAppend(&msg, " ");
45 ctx->SetStatus(errors::InvalidArgument(msg));
56 explicit PrintOp(OpKernelConstruction* ctx)
57 : OpKernel(ctx), call_counter_(0) {
58 OP_REQUIRES_OK(ctx, ctx->GetAttr("message", &message_));
59 OP_REQUIRES_OK(ctx, ctx->GetAttr("first_n", &first_n_));
60 OP_REQUIRES_OK(ctx, ctx->GetAttr("summarize", &summarize_));
63 void Compute(OpKernelContext* ctx) override {
64 if (IsRefType(ctx->input_dtype(0))) {
65 ctx->forward_ref_input_to_ref_output(0, 0);
67 ctx->set_output(0, ctx->input(0));
76 for (int i = 1; i < ctx->num_inputs(); ++i) {
77 strings::StrAppend(&msg, "[", ctx->input(i).SummarizeValue(summarize_),