SetStorageFormat
函数功能
向CompileTimeTensorDesc中设置运行时Tensor的数据排布格式。
函数原型
1 | void SetStorageFormat(const ge::Format format) |
参数说明
参数 |
输入/输出 |
说明 |
---|---|---|
format |
输入 |
需要设置的运行时数据排布格式信息。 关于ge::Format的定义,请参见Format。 |
返回值说明
无。
约束说明
无。
调用示例
1 2 3 4 5 6 7 8 9 10 11 12 | 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") |