| 214 | explicit WriteScalarSummaryOp(OpKernelConstruction* ctx) : OpKernel(ctx) {} |
| 215 | |
| 216 | void Compute(OpKernelContext* ctx) override { |
| 217 | core::RefCountPtr<SummaryWriterInterface> s; |
| 218 | OP_REQUIRES_OK(ctx, LookupResource(ctx, HandleFromInput(ctx, 0), &s)); |
| 219 | const Tensor* tmp; |
| 220 | OP_REQUIRES_OK(ctx, ctx->input("step", &tmp)); |
| 221 | const int64 step = tmp->scalar<int64>()(); |
| 222 | OP_REQUIRES_OK(ctx, ctx->input("tag", &tmp)); |
| 223 | const string& tag = tmp->scalar<tstring>()(); |
| 224 | |
| 225 | const Tensor* t; |
| 226 | OP_REQUIRES_OK(ctx, ctx->input("value", &t)); |
| 227 | |
| 228 | OP_REQUIRES_OK(ctx, s->WriteScalar(step, *t, tag)); |
| 229 | } |
| 230 | }; |
| 231 | REGISTER_KERNEL_BUILDER(Name("WriteScalarSummary").Device(DEVICE_CPU), |
| 232 | WriteScalarSummaryOp); |
nothing calls this directly
no test coverage detected