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

Method Compute

tensorflow/core/kernels/summary_kernels.cc:301–317  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

299 }
300
301 void Compute(OpKernelContext* ctx) override {
302 core::RefCountPtr<SummaryWriterInterface> s;
303 OP_REQUIRES_OK(ctx, LookupResource(ctx, HandleFromInput(ctx, 0), &s));
304 const Tensor* tmp;
305 OP_REQUIRES_OK(ctx, ctx->input("step", &tmp));
306 const int64 step = tmp->scalar<int64>()();
307 OP_REQUIRES_OK(ctx, ctx->input("tag", &tmp));
308 const string& tag = tmp->scalar<tstring>()();
309 OP_REQUIRES_OK(ctx, ctx->input("sample_rate", &tmp));
310 const float sample_rate = tmp->scalar<float>()();
311
312 const Tensor* t;
313 OP_REQUIRES_OK(ctx, ctx->input("tensor", &t));
314
315 OP_REQUIRES_OK(ctx,
316 s->WriteAudio(step, *t, tag, max_outputs_, sample_rate));
317 }
318
319 private:
320 int max_outputs_;

Callers

nothing calls this directly

Calls 4

LookupResourceFunction · 0.85
HandleFromInputFunction · 0.85
inputMethod · 0.45
WriteAudioMethod · 0.45

Tested by

no test coverage detected