| 42 | } |
| 43 | |
| 44 | void ArgOp::Compute(OpKernelContext* ctx) { |
| 45 | auto frame = ctx->call_frame(); |
| 46 | OP_REQUIRES(ctx, frame != nullptr, errors::Internal("no call frame")); |
| 47 | Tensor val; |
| 48 | OP_REQUIRES_OK(ctx, frame->GetArg(index_, &val)); |
| 49 | OP_REQUIRES(ctx, val.dtype() == dtype_, |
| 50 | errors::InvalidArgument("Type mismatch: actual ", |
| 51 | DataTypeString(val.dtype()), |
| 52 | " vs. expect ", DataTypeString(dtype_))); |
| 53 | ctx->set_output(0, val); |
| 54 | } |
| 55 | |
| 56 | RetvalOp::RetvalOp(OpKernelConstruction* ctx) : OpKernel(ctx) { |
| 57 | OP_REQUIRES_OK(ctx, ctx->GetAttr("T", &dtype_)); |
nothing calls this directly
no test coverage detected