| 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_; |
nothing calls this directly
no test coverage detected