Browse Source

support equal list with none

tags/v0.2.0-alpha
buxue 5 years ago
parent
commit
c853f985cc
2 changed files with 32 additions and 1 deletions
  1. +1
    -1
      mindspore/ccsrc/operator/composite/composite.cc
  2. +31
    -0
      mindspore/ops/composite/multitype_ops/equal_impl.py

+ 1
- 1
mindspore/ccsrc/operator/composite/composite.cc View File

@@ -743,7 +743,7 @@ FuncGraphPtr MultitypeFuncGraph::GenerateFromTypes(const TypePtrList& types) {
}
oss << ++idx << ". " << item.first << "\n " << trace::GetDebugInfo(func_graph->debug_info()) << "\n";
}
MS_LOG(EXCEPTION) << "Fail to find overload function for `" << name_ << "` with type " << buffer.str() << "\n"
MS_LOG(EXCEPTION) << "The '" << name_ << "' operation does not support the type " << buffer.str() << "\n"
<< oss.str();
}



+ 31
- 0
mindspore/ops/composite/multitype_ops/equal_impl.py View File

@@ -190,6 +190,7 @@ def _none_equal_tuple(x, y):
"""
return False


@equal.register("Tensor", "Number")
@equal.register("Number", "Tensor")
@equal.register("Tensor", "Tensor")
@@ -235,3 +236,33 @@ def _none_equal_tensor(x, y):
bool, return false.
"""
return False


@equal.register("List", "None")
def _list_equal_none(x, y):
"""
Determine if list equal none.

Args:
x (list): The first input which is a list.
y (none): The second input which is none.

Returns:
bool, return false.
"""
return False


@equal.register("None", "List")
def _none_equal_list(x, y):
"""
Determine if none equal list.

Args:
x (none): The first input which is none.
y (list): The second input which is a list.

Returns:
bool, return false.
"""
return False

Loading…
Cancel
Save