Check checks if the previous operation caused an error and thus tensor.Path.Err is not nil. If it's not, panics because we're defining the graph in a wrong way
()
| 44 | // and thus tensor.Path.Err is not nil. |
| 45 | // If it's not, panics because we're defining the graph in a wrong way |
| 46 | func (tensor *Tensor) Check() { |
| 47 | err := tensor.Path.Err() |
| 48 | if err != nil { |
| 49 | panic(err.Error()) |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | // Scope returns the scope associated to the tensor |
| 54 | func (tensor *Tensor) Scope() *op.Scope { |