| Parameter | Input/Output | Description |
|---|---|---|
| idx | Input | Index of dim. You must ensure that the index is valid. |
const int64_t &operator[](size_t idx) const: dimension value. When idx is greater than or equal to kMaxDimNum, the behavior is not defined.
int64_t &operator[](size_t idx): dimension value. When idx is greater than or equal to kMaxDimNum, the behavior is not defined.
Shape shape0({3, 256, 256});
auto dim0 = shape0[0]; // The dimension size of axis 0 is 3.
auto dim1 = shape0[1]; // The dimension size of axis 1 is 256.
auto dim2 = shape0[2]; // The dimension size of axis 2 is 256.
auto invalid_dim = shape0[kMaxDimNum]; // The behavior is not defined.