NewNumber returns a new n-dimensional tensor of numerical values with the given sizes per dimension (shape), and optional dimension names.
(sizes []int, names ...string)
| 69 | // NewNumber returns a new n-dimensional tensor of numerical values |
| 70 | // with the given sizes per dimension (shape), and optional dimension names. |
| 71 | func NewNumber[T num.Number](sizes []int, names ...string) *Number[T] { |
| 72 | tsr := &Number[T]{} |
| 73 | tsr.SetShape(sizes, names...) |
| 74 | tsr.Values = make([]T, tsr.Len()) |
| 75 | return tsr |
| 76 | } |
| 77 | |
| 78 | // NewNumberShape returns a new n-dimensional tensor of numerical values |
| 79 | // using given shape. |