clean code

This commit is contained in:
liutongtong 2022-08-03 16:47:16 +08:00
parent e23bcfad2d
commit 2db33451f0
4 changed files with 7 additions and 4 deletions

View File

@ -10,7 +10,7 @@
#### FrontEnd
- [BETA] Add `mindspore.Model.fit` API, add `mindspore.callback.EarlyStopping` and `mindspore.callback.ReduceLROnPlateau` in Callback.
- [BETA] Add `mindspore.Model.fit` API, add `mindspore.train.callback.EarlyStopping` and `mindspore.train.callback.ReduceLROnPlateau` in Callback.
- [BETA] Support custom operator implemented by Julia.
- [BETA] Support custom operator implemented by MindSpore Hybrid DSL.
- [STABLE] The export() interface supports the export of a model using a custom encryption algorithm, and the load() interface supports the import of a model using a custom decryption algorithm.

View File

@ -10,7 +10,7 @@
#### FrontEnd
- [BETA] 提供`mindspore.Model.fit` API增加两种callback方法 `mindspore.callback.EarlyStopping` 和 `mindspore.callback.ReduceLROnPlateau`。
- [BETA] 提供`mindspore.Model.fit` API增加两种callback方法 `mindspore.train.callback.EarlyStopping` 和 `mindspore.train.callback.ReduceLROnPlateau`。
- [BETA] 自定义算子支持Julia算子。
- [BETA] 自定义算子支持Hybrid DSL算子。
- [STABLE] export()接口支持自定义加密算法导出模型load()接口支持自定义解密算法导入模型。

View File

@ -219,7 +219,7 @@ GeTensorPtr ConvertStringTensor(const MeTensorPtr &tensor, const std::string &fo
std::string string_to_add(string_element, string_length);
(void)string_vector.emplace_back(string_to_add);
}
delete string_element;
delete[] string_element;
string_element = nullptr;
tensor_ptr = make_shared<GeTensor>(*desc);
(void)tensor_ptr->SetData(string_vector);
@ -236,7 +236,7 @@ GeTensorPtr ConvertStringTensor(const MeTensorPtr &tensor, const std::string &fo
std::string string_to_add(string_element, string_length);
tensor_ptr = make_shared<GeTensor>(*desc);
(void)tensor_ptr->SetData(string_to_add);
delete string_element;
delete[] string_element;
string_element = nullptr;
}
return tensor_ptr;

View File

@ -1544,6 +1544,9 @@ class Cell(Cell_):
>>>
>>> net = nn.Conv2d(120, 240, 4, has_bias=False, weight_init='normal')
>>> net.to_float(mstype.float16)
Supported Platforms:
``Ascend`` ``GPU`` ``CPU``
"""
if dst_type not in (mstype.float16, mstype.float32):
raise ValueError("For 'to_float', the argument 'dst_type' must be float32 or float16, "