Accessor to set the value of one of the dimensions. * * @param[in] dimension Dimension for which the value is set. * @param[in] value Value to be set for the dimension. * @param[in] increase_dim_unit (Optional) Set to true if new unit dimensions increase the number of dimensions (e.g. for Coordinates), false otherwise (e.g. for TensorShapes) */
| 77 | * @param[in] increase_dim_unit (Optional) Set to true if new unit dimensions increase the number of dimensions (e.g. for Coordinates), false otherwise (e.g. for TensorShapes) |
| 78 | */ |
| 79 | void set(size_t dimension, T value, bool increase_dim_unit = true) |
| 80 | { |
| 81 | ARM_COMPUTE_ERROR_ON(dimension >= num_max_dimensions); |
| 82 | _id[dimension] = value; |
| 83 | // Don't increase the number of dimensions if the new dimension is 1 |
| 84 | if (increase_dim_unit || value != 1) |
| 85 | { |
| 86 | _num_dimensions = std::max(_num_dimensions, dimension + 1); |
| 87 | } |
| 88 | } |
| 89 | /** Alias to access the size of the first dimension */ |
| 90 | T x() const |
| 91 | { |
no outgoing calls
no test coverage detected