SetStorageFormat

Description

Sets the storage format of a tensor.

Prototype

void SetStorageFormat(const ge::Format storage_format)

Parameters

Parameter

Input/Output

Description

storage_format

Input

Storage format.

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

Returns

None

Restrictions

None

Example

StorageShape sh({1, 2, 3}, {1, 2, 3});
Tensor 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.GetStorageFormat(); // ge::FORMAT_NC1HWC0