NumDimensions returns the number of dimensions represented by s, or -1 if unknown.
()
| 48 | // NumDimensions returns the number of dimensions represented by s, or -1 if |
| 49 | // unknown. |
| 50 | func (s Shape) NumDimensions() int { |
| 51 | if s.dims == nil { |
| 52 | return -1 |
| 53 | } |
| 54 | return len(s.dims) |
| 55 | } |
| 56 | |
| 57 | // Size returns the size of the dim-th dimension of the shape, or -1 if it |
| 58 | // is unknown. |
no outgoing calls