MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / Compute

Method Compute

tensorflow/core/kernels/immutable_constant_op.cc:92–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90}
91
92void 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
104ImmutableConstantOp::~ImmutableConstantOp() {}
105constexpr char const* ImmutableConstantOp::kDTypeAttr;

Callers

nothing calls this directly

Calls 7

InitializeFromRegionMethod · 0.80
TensorClass · 0.70
envMethod · 0.45
set_outputMethod · 0.45
getMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected