MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / Compute

Method Compute

tensorflow/core/kernels/summary_kernels.cc:216–229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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};
231REGISTER_KERNEL_BUILDER(Name("WriteScalarSummary").Device(DEVICE_CPU),
232 WriteScalarSummaryOp);

Callers

nothing calls this directly

Calls 4

LookupResourceFunction · 0.85
HandleFromInputFunction · 0.85
inputMethod · 0.45
WriteScalarMethod · 0.45

Tested by

no test coverage detected