Restores a tensor from checkpoint files. Reads a tensor stored in one or several files. If there are several files (for instance because a tensor was saved as slices), `file_pattern` may contain wildcard symbols (`*` and `?`) in the filename portion only, not in the directory portion. If a `file_p
(scope *Scope, file_pattern tf.Output, tensor_name tf.Output, dt tf.DataType, optional ...RestoreAttr)
| 32536 | // |
| 32537 | // Returns The restored tensor. |
| 32538 | func Restore(scope *Scope, file_pattern tf.Output, tensor_name tf.Output, dt tf.DataType, optional ...RestoreAttr) (tensor tf.Output) { |
| 32539 | if scope.Err() != nil { |
| 32540 | return |
| 32541 | } |
| 32542 | attrs := map[string]interface{}{"dt": dt} |
| 32543 | for _, a := range optional { |
| 32544 | a(attrs) |
| 32545 | } |
| 32546 | opspec := tf.OpSpec{ |
| 32547 | Type: "Restore", |
| 32548 | Input: []tf.Input{ |
| 32549 | file_pattern, tensor_name, |
| 32550 | }, |
| 32551 | Attrs: attrs, |
| 32552 | } |
| 32553 | op := scope.AddOperation(opspec) |
| 32554 | return op.Output(0) |
| 32555 | } |
| 32556 | |
| 32557 | // Compute the pairwise cross product. |
| 32558 | // |