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)
| 4027 | // memory_region_name: Name of readonly memory region used by the tensor, see |
| 4028 | // NewReadOnlyMemoryRegionFromFile in tensorflow::Env. |
| 4029 | func 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 | // |