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

Function RestoreSlice

tensorflow/go/op/wrappers.go:40302–40319  ·  view source on GitHub ↗

Restores a tensor from checkpoint files. This is like `Restore` except that restored tensor can be listed as filling only a slice of a larger tensor. `shape_and_slice` specifies the shape of the larger tensor and the slice that the restored tensor covers. The `shape_and_slice` input has the same

(scope *Scope, file_pattern tf.Output, tensor_name tf.Output, shape_and_slice tf.Output, dt tf.DataType, optional ...RestoreSliceAttr)

Source from the content-addressed store, hash-verified

40300//
40301// Returns The restored tensor.
40302func RestoreSlice(scope *Scope, file_pattern tf.Output, tensor_name tf.Output, shape_and_slice tf.Output, dt tf.DataType, optional ...RestoreSliceAttr) (tensor tf.Output) {
40303 if scope.Err() != nil {
40304 return
40305 }
40306 attrs := map[string]interface{}{"dt": dt}
40307 for _, a := range optional {
40308 a(attrs)
40309 }
40310 opspec := tf.OpSpec{
40311 Type: "RestoreSlice",
40312 Input: []tf.Input{
40313 file_pattern, tensor_name, shape_and_slice,
40314 },
40315 Attrs: attrs,
40316 }
40317 op := scope.AddOperation(opspec)
40318 return op.Output(0)
40319}
40320
40321// Generate a sharded filename. The filename is printf formatted as
40322//

Callers 1

TEST_FFunction · 0.85

Calls 4

aClass · 0.85
ErrMethod · 0.45
AddOperationMethod · 0.45
OutputMethod · 0.45

Tested by 1

TEST_FFunction · 0.68