GetViewShape
Function Usage
Obtains the ViewShape of an aclTensor. ViewShape indicates the logical shape of an aclTensor.
Assume that the StorageShape and ViewShape of an aclTensor are as follows:
- If the StorageShape is [10, 20], the aclTensor is arranged in the memory based on [10, 20].
- If the ViewShape is [2, 5, 20], the aclTensor can be considered as data with the shape [2, 5, 20] for use.
Prototype
gert::Shape GetViewShape()
Parameters
None
Returns
gert::Shape, which records a group of shape information, for example, a 3D shape [10, 20, 30].
Constraints
None
Example
1 2 3 |
void Func(const aclTensor *input) { auto shape = input->GetViewShape(); } |
Parent topic: common_types