目录

GetShape

Function Description

Obtains the shapes of a tensor, including the storage and original shapes.

Function Prototype

const StorageShape &GetShape() const
StorageShape &GetShape()

Parameters

None

Return Value

For details about the definition of the StorageShape type, see StorageShape.

Restrictions

None

Calling Example

StorageShape sh({1, 2, 3}, {2, 1, 3});
Tensor t = {sh, {}, {}, ge::DT_FLOAT, nullptr};
auto shape = t.GetShape(); // sh