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

Function ImmutableConst

tensorflow/go/op/wrappers.go:4029–4041  ·  view source on GitHub ↗

Returns immutable tensor from memory region. The current implementation memmaps the tensor from a file. Arguments: dtype: Type of the returned tensor. shape: Shape of the returned tensor. memory_region_name: Name of readonly memory region used by the tensor, see NewReadOnlyMemoryRegionFromFile

(scope *Scope, dtype tf.DataType, shape tf.Shape, memory_region_name string)

Source from the content-addressed store, hash-verified

4027// memory_region_name: Name of readonly memory region used by the tensor, see
4028// NewReadOnlyMemoryRegionFromFile in tensorflow::Env.
4029func ImmutableConst(scope *Scope, dtype tf.DataType, shape tf.Shape, memory_region_name string) (tensor tf.Output) {
4030 if scope.Err() != nil {
4031 return
4032 }
4033 attrs := map[string]interface{}{"dtype": dtype, "shape": shape, "memory_region_name": memory_region_name}
4034 opspec := tf.OpSpec{
4035 Type: "ImmutableConst",
4036
4037 Attrs: attrs,
4038 }
4039 op := scope.AddOperation(opspec)
4040 return op.Output(0)
4041}
4042
4043// Checks whether a tree has been initialized.
4044//

Callers 2

TEST_FFunction · 0.85
TESTFunction · 0.85

Calls 3

ErrMethod · 0.45
AddOperationMethod · 0.45
OutputMethod · 0.45

Tested by 2

TEST_FFunction · 0.68
TESTFunction · 0.68