SetExpandDimsType
Description
Sets the dimension expansion rule for converting the original format to the runtime format.
Prototype
void SetExpandDimsType(const ExpandDimsType &expand_dims_type)
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
expand_dims_type |
Input |
Dimension expansion rule to be set. For details about ExpandDimsType, see ExpandDimsType. |
Returns
None
Restrictions
None
Example
auto dtype_ = ge::DataType::DT_INT32;
StorageFormat fmt_(ge::Format::FORMAT_NC, ge::FORMAT_NCHW, {});
ExpandDimsType type_("1001");
gert::CompileTimeTensorDesc td;
td.SetDataType(dtype_);
auto dtype = td.GetDataType(); // ge::DataType::DT_INT32;
td.SetStorageFormat(fmt_.GetStorageFormat());
auto storage_fmt = td.GetStorageFormat(); // ge::FORMAT_NCHW
td.SetOriginFormat(fmt_.GetOriginFormat());
auto origin_fmt = td.GetOriginFormat(); // ge::Format::FORMAT_NC
td.SetExpandDimsType(type_);auto type = td.GetExpandDimsType(); // type_("1001")
Parent topic: CompileTimeTensorDesc