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

Method Compute

tensorflow/core/kernels/summary_kernels.cc:266–285  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

264 }
265
266 void Compute(OpKernelContext* ctx) override {
267 core::RefCountPtr<SummaryWriterInterface> s;
268 OP_REQUIRES_OK(ctx, LookupResource(ctx, HandleFromInput(ctx, 0), &s));
269 const Tensor* tmp;
270 OP_REQUIRES_OK(ctx, ctx->input("step", &tmp));
271 const int64 step = tmp->scalar<int64>()();
272 OP_REQUIRES_OK(ctx, ctx->input("tag", &tmp));
273 const string& tag = tmp->scalar<tstring>()();
274 const Tensor* bad_color;
275 OP_REQUIRES_OK(ctx, ctx->input("bad_color", &bad_color));
276 OP_REQUIRES(
277 ctx, TensorShapeUtils::IsVector(bad_color->shape()),
278 errors::InvalidArgument("bad_color must be a vector, got shape ",
279 bad_color->shape().DebugString()));
280
281 const Tensor* t;
282 OP_REQUIRES_OK(ctx, ctx->input("tensor", &t));
283
284 OP_REQUIRES_OK(ctx, s->WriteImage(step, *t, tag, max_images_, *bad_color));
285 }
286
287 private:
288 int32 max_images_;

Callers

nothing calls this directly

Calls 7

LookupResourceFunction · 0.85
HandleFromInputFunction · 0.85
InvalidArgumentFunction · 0.85
inputMethod · 0.45
shapeMethod · 0.45
DebugStringMethod · 0.45
WriteImageMethod · 0.45

Tested by

no test coverage detected