---
title: operator==
description: "判断格式是否相同。"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/maintenref/basicdataapi/atlasopapi_07_00171.html
sourcePath: /source/zh/canncommercial/900/maintenref/basicdataapi/atlasopapi_07_00171.html
indexId: ab930a18725f9680712239c4102a7eece0027788ca3b7476af96d54d663841cf78
---
# operator==

#### 函数功能

判断格式是否相同。


#### 函数原型

```
bool operator==(const StorageFormat &other) const
```


#### 参数说明

| 参数 | 输入/输出 | 说明 |
| --- | --- | --- |
| other | 输入 | 另一种格式。 |


#### 返回值说明

true代表格式相同，false代表格式不相同。


#### 约束说明

无。


#### 调用示例

```
ExpandDimsType dim_type("1100");
StorageFormat format(ge::Format::FORMAT_NCHW, ge::Format::FORMAT_C1HWNC0, dim_type);
StorageFormat another_format(ge::Format::FORMAT_NCHW, ge::Format::FORMAT_NC, dim_type);
bool is_same_fmt = format == another_format; // false
```
