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)
| 40300 | // |
| 40301 | // Returns The restored tensor. |
| 40302 | func 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 | // |