| 32 | class ErrorOp : public OpKernel { |
| 33 | public: |
| 34 | explicit ErrorOp(OpKernelConstruction* ctx) : OpKernel(ctx) { |
| 35 | OP_REQUIRES_OK(ctx, ctx->GetAttr("message", &errmsg_)); |
| 36 | OP_REQUIRES_OK(ctx, ctx->GetAttr("log_error", &log_error_)); |
| 37 | } |
| 38 | |
| 39 | void Compute(OpKernelContext* ctx) override { |
| 40 | // Log only when CancellationManager is set to skip logging when Compute() |