|
|
@ -389,8 +389,7 @@ std::vector<int64_t> CheckAndConvertUtils::ConvertShapePtrToShape(const std::str
|
|
|
|
const std::string &prim_name) {
|
|
|
|
const std::string &prim_name) {
|
|
|
|
MS_EXCEPTION_IF_NULL(shape);
|
|
|
|
MS_EXCEPTION_IF_NULL(shape);
|
|
|
|
if (!shape->isa<abstract::Shape>()) {
|
|
|
|
if (!shape->isa<abstract::Shape>()) {
|
|
|
|
MS_EXCEPTION(ValueError) << "The " << arg_name << "'s shape is " << shape->ToString()
|
|
|
|
return std::vector<int64_t>();
|
|
|
|
<< "should be a common shape!";
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
auto shape_element = shape->cast<abstract::ShapePtr>();
|
|
|
|
auto shape_element = shape->cast<abstract::ShapePtr>();
|
|
|
|
MS_EXCEPTION_IF_NULL(shape_element);
|
|
|
|
MS_EXCEPTION_IF_NULL(shape_element);
|
|
|
@ -500,7 +499,7 @@ TypePtr CheckAndConvertUtils::_CheckTypeSame(const std::map<std::string, TypePtr
|
|
|
|
MS_EXCEPTION_IF_NULL(type);
|
|
|
|
MS_EXCEPTION_IF_NULL(type);
|
|
|
|
if (!allow_mix) {
|
|
|
|
if (!allow_mix) {
|
|
|
|
// input must be all tensor or all other type
|
|
|
|
// input must be all tensor or all other type
|
|
|
|
if (!(tensor_flag ^ type->isa<TensorType>())) {
|
|
|
|
if (tensor_flag ^ type->isa<TensorType>()) {
|
|
|
|
buffer << "For " << prim_name << "'s "
|
|
|
|
buffer << "For " << prim_name << "'s "
|
|
|
|
<< "type is not same";
|
|
|
|
<< "type is not same";
|
|
|
|
for (const auto &error_elem : args) {
|
|
|
|
for (const auto &error_elem : args) {
|
|
|
|