| 55 | |
| 56 | private: |
| 57 | void Output(OpKernelContext* ctx, int idx, const BCast::Vec& v) { |
| 58 | const int64 len = v.size(); |
| 59 | Tensor* o = nullptr; |
| 60 | OP_REQUIRES_OK(ctx, ctx->allocate_output(idx, TensorShape({len}), &o)); |
| 61 | for (int64 i = 0; i < len; ++i) { |
| 62 | o->flat<T>()(i) = static_cast<T>(v[i]); |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | TF_DISALLOW_COPY_AND_ASSIGN(BCastArgsOp); |
| 67 | }; |