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

Method Compute

tensorflow/core/kernels/summary_kernels.cc:196–208  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

194 explicit ImportEventOp(OpKernelConstruction* ctx) : OpKernel(ctx) {}
195
196 void Compute(OpKernelContext* ctx) override {
197 core::RefCountPtr<SummaryWriterInterface> s;
198 OP_REQUIRES_OK(ctx, LookupResource(ctx, HandleFromInput(ctx, 0), &s));
199 const Tensor* t;
200 OP_REQUIRES_OK(ctx, ctx->input("event", &t));
201 std::unique_ptr<Event> event{new Event};
202 if (!ParseProtoUnlimited(event.get(), t->scalar<tstring>()())) {
203 ctx->CtxFailureWithWarning(
204 errors::DataLoss("Bad tf.Event binary proto tensor string"));
205 return;
206 }
207 OP_REQUIRES_OK(ctx, s->WriteEvent(std::move(event)));
208 }
209};
210REGISTER_KERNEL_BUILDER(Name("ImportEvent").Device(DEVICE_CPU), ImportEventOp);
211

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
WriteEventMethod · 0.45

Tested by

no test coverage detected