| 49 | */ |
| 50 | template <typename... Ts> |
| 51 | TensorShape(Ts... dims) : Dimensions{dims...} |
| 52 | { |
| 53 | // Initialize unspecified dimensions to 1 |
| 54 | if (_num_dimensions > 0) |
| 55 | { |
| 56 | std::fill(_id.begin() + _num_dimensions, _id.end(), 1); |
| 57 | } |
| 58 | |
| 59 | // Correct number dimensions to ignore trailing dimensions of size 1 |
| 60 | apply_dimension_correction(); |
| 61 | } |
| 62 | /** Allow instances of this class to be copy constructed */ |
| 63 | TensorShape(const TensorShape &) = default; |
| 64 | /** Allow instances of this class to be copied */ |