| 90 | } |
| 91 | |
| 92 | void ImmutableConstantOp::Compute(OpKernelContext* ctx) { |
| 93 | std::unique_ptr<MemmappedTensorAllocator> allocator( |
| 94 | new MemmappedTensorAllocator()); |
| 95 | |
| 96 | OP_REQUIRES_OK(ctx, |
| 97 | allocator->InitializeFromRegion(region_name_, ctx->env())); |
| 98 | ctx->set_output(0, Tensor(allocator.get(), dtype_, shape_)); |
| 99 | OP_REQUIRES_OK(ctx, allocator->allocation_status()); |
| 100 | // Allocator is owned by the tensor from this point. |
| 101 | allocator.release()->set_delete_on_deallocate(); |
| 102 | } |
| 103 | |
| 104 | ImmutableConstantOp::~ImmutableConstantOp() {} |
| 105 | constexpr char const* ImmutableConstantOp::kDTypeAttr; |
nothing calls this directly
no test coverage detected