forked from mindspore-Ecosystem/mindspore
Fix codecheck for master
This commit is contained in:
parent
e4975bba6d
commit
d1651800bf
|
@ -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]),)
|
||||
|
|
|
@ -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 << ">";
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
from mindspore import log
|
||||
|
||||
|
||||
def deprecated(version, substitute, use_substitute_name=False):
|
||||
"""deprecated warning
|
||||
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -850,7 +850,6 @@ class GatherV2(PrimitiveWithCheck):
|
|||
Please use Gather instead.
|
||||
"""
|
||||
|
||||
# deprecate_new_name = "Gather"
|
||||
|
||||
@deprecated("1.1", "Gather", True)
|
||||
@prim_attr_register
|
||||
|
|
Loading…
Reference in New Issue