Browse Source

improve the implicit conversion rule when there are float Number and other type Number

tags/v1.1.0
buxue 5 years ago
parent
commit
d145bd62f5
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      mindspore/ccsrc/frontend/operator/composite/do_signature.cc
  2. +1
    -1
      mindspore/ccsrc/pipeline/pynative/pynative_execute.cc

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

@@ -143,7 +143,7 @@ TypeId GetMaxTypeId(const std::vector<TypePtr> &input_types, std::vector<size_t>
} }
} }
if (max_type_id != kNumberTypeFloat16 && max_type_id != kNumberTypeFloat32 && max_type_id != kNumberTypeFloat64 && if (max_type_id != kNumberTypeFloat16 && max_type_id != kNumberTypeFloat32 && max_type_id != kNumberTypeFloat64 &&
has_scalar_float32) {
max_type_id != kTypeUnknown && has_scalar_float32) {
max_type_id = kNumberTypeFloat32; max_type_id = kNumberTypeFloat32;
} }
return max_type_id; return max_type_id;


+ 1
- 1
mindspore/ccsrc/pipeline/pynative/pynative_execute.cc View File

@@ -224,7 +224,7 @@ std::map<SignatureEnumDType, TypeId> GetDstType(const py::tuple &py_args,
} }
} }
if (max_type != TypeId::kNumberTypeFloat16 && max_type != TypeId::kNumberTypeFloat32 && if (max_type != TypeId::kNumberTypeFloat16 && max_type != TypeId::kNumberTypeFloat32 &&
max_type != TypeId::kNumberTypeFloat64 && has_float) {
max_type != TypeId::kNumberTypeFloat64 && max_type != TypeId::kTypeUnknown && has_float) {
max_type = TypeId::kNumberTypeFloat32; max_type = TypeId::kNumberTypeFloat32;
} }
if (max_type == TypeId::kNumberTypeUInt8 && has_int8) { if (max_type == TypeId::kNumberTypeUInt8 && has_int8) {


Loading…
Cancel
Save