| 31 | } |
| 32 | |
| 33 | void Compute(OpKernelContext* context) override { |
| 34 | const Tensor& input_tensor = context->input(0); |
| 35 | Tensor* output_tensor = nullptr; |
| 36 | OP_REQUIRES_OK(context, context->allocate_output(0, input_tensor.shape(), |
| 37 | &output_tensor)); |
| 38 | |
| 39 | auto input = input_tensor.flat<tstring>(); |
| 40 | auto output = output_tensor->flat<tstring>(); |
| 41 | |
| 42 | for (int64 i = 0; i < input.dimension(0); ++i) { |
| 43 | OP_REQUIRES_OK(context, Base64Encode(input(i), pad_, &output(i))); |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | private: |
| 48 | bool pad_; |
nothing calls this directly
no test coverage detected