GetOriginFormat

Function Usage

Obtains the original data format of a tensor.

Prototype

1
ge::Format GetOriginFormat() const

Parameters

None

Returns

Original data format.

For details about the definition of the ge::Format type, see Format.

Constraints

None

Examples

1
2
3
4
5
StorageShape sh({1, 2, 3}, {1, 2, 3});
TensorV2 t = {sh, {ge::FORMAT_ND, ge::FORMAT_FRACTAL_NZ, {}}, kOnHost, ge::DT_FLOAT, nullptr};
t.SetOriginFormat(ge::FORMAT_NHWC);
t.SetStorageFormat(ge::FORMAT_NC1HWC0);
auto fmt = t.GetOriginFormat(); // ge::FORMAT_NHWC