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