Fix codecheck for master

This commit is contained in:
l00591931 2021-05-20 16:11:19 +08:00
parent e4975bba6d
commit d1651800bf
6 changed files with 6 additions and 5 deletions

View File

@ -1454,7 +1454,8 @@ def enumerate_(x, start=0):
x_type = F.typeof(x)
ret = ()
op_name = "enumerate"
if check_is_tuple_or_list_or_tensor(x_type, op_name, "first input") and check_is_const_int(start, op_name, "start"):
if check_is_tuple_or_list_or_tensor(x_type, op_name, "first input") and \
check_is_const_int(start, op_name, "start"):
if check_is_tensor(x_type):
for i in range(x.shape[0]):
ret += ((start + i, x[i]),)

View File

@ -67,7 +67,7 @@ void PrintNodeOutputType(std::ostringstream &buffer, const AnfNodePtr &nd) {
abstract::ShapePtr shape = dyn_cast<abstract::Shape>(nd->Shape());
TypePtr type = dyn_cast<Type>(nd->Type());
if ((nullptr != shape) && (nullptr != type)) {
if ((shape != nullptr) && (type != nullptr)) {
buffer << "<" << type << "x" << shape->shape() << ">";
} else if (nullptr != type) {
buffer << "<" << type << ">";

View File

@ -524,7 +524,7 @@ void ExportDFGraph(const std::string &file_name, const std::string &phase) {
}
transform::DfGraphPtr ge_graph = wrap_ptr->graph_ptr_;
if (nullptr == ge_graph) {
if (ge_graph == nullptr) {
MS_LOG(ERROR) << "Graph is null!";
return;
}

View File

@ -16,6 +16,7 @@
from mindspore import log
def deprecated(version, substitute, use_substitute_name=False):
"""deprecated warning

View File

@ -202,7 +202,7 @@ AbstractBasePtr InferTupleOrListSetItem(const std::string &op_name, const Abstra
int64_t idx_t = idx_v >= 0 ? idx_v : idx_v + SizeToLong(nelems);
if (idx_t < 0 || idx_t >= SizeToLong(nelems)) {
MS_EXCEPTION(IndexError) << op_name << " evaluator the index: " << idx_v << " to set out of range: [-" << nelems
<< "," << nelems - 1 << "].";
<< "," << (nelems - 1) << "].";
}
size_t uidx_v = LongToSize(idx_t);
elements[uidx_v] = args_spec_list[2];

View File

@ -850,7 +850,6 @@ class GatherV2(PrimitiveWithCheck):
Please use Gather instead.
"""
# deprecate_new_name = "Gather"
@deprecated("1.1", "Gather", True)
@prim_attr_register