GetShape
Function Usage
Obtains the shapes of a tensor, including the runtime and original shapes.
Prototype
const StorageShape &GetShape() const StorageShape &GetShape()
Parameters
None
Returns
- const StorageShape &GetShape() const: returns a read-only shape reference.
- StorageShape &GetShape(): returns a shape reference.
- For details about the definition of the StorageShape type, see StorageShape.
Constraints
None
Examples
1 2 3 | StorageShape sh({1, 2, 3}, {2, 1, 3}); TensorV2 t = {sh, {ge::FORMAT_ND, ge::FORMAT_FRACTAL_NZ, {}}, kOnHost, ge::DT_FLOAT, nullptr}; auto shape = t.GetShape(); // sh |
Parent topic: TensorV2