SetShape sets the shape size and optional names RowMajor ordering is used by default.
(sizes []int, names ...string)
| 37 | // SetShape sets the shape size and optional names |
| 38 | // RowMajor ordering is used by default. |
| 39 | func (sh *Shape) SetShape(sizes []int, names ...string) { |
| 40 | sh.Sizes = slices.Clone(sizes) |
| 41 | sh.Strides = RowMajorStrides(sizes) |
| 42 | sh.Names = make([]string, len(sh.Sizes)) |
| 43 | if len(names) == len(sizes) { |
| 44 | copy(sh.Names, names) |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | // CopyShape copies the shape parameters from another Shape struct. |
| 49 | // copies the data so it is not accidentally subject to updates. |
no test coverage detected