NewTensor creates a *Tensor from a tf.Output Place the cloned tensor within the specified scope
(scope *op.Scope, tfout tf.Output)
| 32 | // NewTensor creates a *Tensor from a tf.Output |
| 33 | // Place the cloned tensor within the specified scope |
| 34 | func NewTensor(scope *op.Scope, tfout tf.Output) (tensor *Tensor) { |
| 35 | tensor = new(Tensor) |
| 36 | tensor.Root = scope |
| 37 | tensor.Path = NewScope(scope) |
| 38 | // Copy the tensor to a new node in the graph |
| 39 | tensor.Output = op.Identity(tensor.Path.SubScope("Identity"), tfout) |
| 40 | return tensor |
| 41 | } |
| 42 | |
| 43 | // Check checks if the previous operation caused an error |
| 44 | // and thus tensor.Path.Err is not nil. |