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

Method Compute

tensorflow/core/kernels/summary_kernels.cc:329–343  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

327 explicit WriteGraphSummaryOp(OpKernelConstruction* ctx) : OpKernel(ctx) {}
328
329 void Compute(OpKernelContext* ctx) override {
330 core::RefCountPtr<SummaryWriterInterface> s;
331 OP_REQUIRES_OK(ctx, LookupResource(ctx, HandleFromInput(ctx, 0), &s));
332 const Tensor* t;
333 OP_REQUIRES_OK(ctx, ctx->input("step", &t));
334 const int64 step = t->scalar<int64>()();
335 OP_REQUIRES_OK(ctx, ctx->input("tensor", &t));
336 std::unique_ptr<GraphDef> graph{new GraphDef};
337 if (!ParseProtoUnlimited(graph.get(), t->scalar<tstring>()())) {
338 ctx->CtxFailureWithWarning(
339 errors::DataLoss("Bad tf.GraphDef binary proto tensor string"));
340 return;
341 }
342 OP_REQUIRES_OK(ctx, s->WriteGraph(step, std::move(graph)));
343 }
344};
345REGISTER_KERNEL_BUILDER(Name("WriteGraphSummary").Device(DEVICE_CPU),
346 WriteGraphSummaryOp);

Callers

nothing calls this directly

Calls 7

LookupResourceFunction · 0.85
HandleFromInputFunction · 0.85
ParseProtoUnlimitedFunction · 0.85
inputMethod · 0.45
getMethod · 0.45
CtxFailureWithWarningMethod · 0.45
WriteGraphMethod · 0.45

Tested by

no test coverage detected