Skip to content

Commit

Permalink
Add inf back
Browse files Browse the repository at this point in the history
  • Loading branch information
justinchuby committed Sep 22, 2023
1 parent eb3526a commit c363da3
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions onnx/version_converter/convert.h
Original file line number Diff line number Diff line change
Expand Up @@ -568,11 +568,27 @@ class DefaultVersionConverter : public BaseVersionConverter {
/******** 19 -> 20 ********/
registerAdapter(std::make_unique<AxisAttributeToInput>("DFT", OpSetID(19), OpSetID(20), 2, 1));
registerAdapter(std::make_unique<CompatibleAdapter>("ConstantOfShape", OpSetID(19), OpSetID(20)));
registerAdapter(std::make_unique<CompatibleAdapter>("IsInf", OpSetID(19), OpSetID(20)));
registerAdapter(std::make_unique<CompatibleAdapter>("IsNaN", OpSetID(19), OpSetID(20)));
registerAdapter(std::make_unique<CompatibleAdapter>("ReduceMax", OpSetID(19), OpSetID(20)));
registerAdapter(std::make_unique<CompatibleAdapter>("ReduceMin", OpSetID(19), OpSetID(20)));
registerAdapter(std::make_unique<GridSample_19_20>());

/******** 20 -> 19 ********/
const std::vector<TensorProto_DataType> is_nan_13_unallowed_types = {
TensorProto_DataType_FLOAT8E4M3FN,
TensorProto_DataType_FLOAT8E4M3FNUZ,
TensorProto_DataType_FLOAT8E5M2,
TensorProto_DataType_FLOAT8E5M2FNUZ};
registerAdapter(std::make_unique<TypeRestriction>("IsNaN", OpSetID(19), OpSetID(20), is_nan_13_unallowed_types));
const std::vector<TensorProto_DataType> is_inf_10_unallowed_types = {
TensorProto_DataType_FLOAT16,
TensorProto_DataType_BFLOAT16,
TensorProto_DataType_FLOAT8E4M3FN,
TensorProto_DataType_FLOAT8E4M3FNUZ,
TensorProto_DataType_FLOAT8E5M2,
TensorProto_DataType_FLOAT8E5M2FNUZ};
registerAdapter(std::make_unique<TypeRestriction>("IsInf", OpSetID(19), OpSetID(20), is_inf_10_unallowed_types));
registerAdapter(std::make_unique<AxisInputToAttribute>("DFT", OpSetID(20), OpSetID(19), 2, -2));
const std::vector<TensorProto_DataType> reduce_min_max_18_unallowed_types = {TensorProto_DataType_BOOL};
registerAdapter(
Expand Down

0 comments on commit c363da3

Please sign in to comment.