SetOriginFormat
Description
Sets the original format of a tensor.
Prototype
void SetOriginFormat(const ge::Format origin_format)
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
origin_format |
Input |
Original 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.GetOriginFormat(); // ge::FORMAT_NHWC
Parent topic: Tensor