Skip to content

Commit

Permalink
common/convert_float_to_float16.cpp: fix generated name of cast op
Browse files Browse the repository at this point in the history
  • Loading branch information
WolframRhodium committed Jan 21, 2022
1 parent bc05b53 commit 0a8c3d1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions common/convert_float_to_float16.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ static ONNX_NAMESPACE::NodeProto make_node(
}



// simplified from
// https://github.com/numpy/numpy/blob/v1.21.5/numpy/core/src/npymath/halffloat.c#L243-L364
// Inf or NaN overflow to signed inf
Expand Down Expand Up @@ -604,7 +603,7 @@ void convert_float_to_float16(
ONNX_NAMESPACE::TensorProto::FLOAT
);
// add Cast node (from tensor(float) to tensor(float16) after current node
const std::string node_name = node->name() + "_input_cast" + std::to_string(i);
const std::string node_name = node->name() + "_output_cast" + std::to_string(i);
auto new_node = make_node(
"Cast", {input_name}, {output}, node_name,
"to", ONNX_NAMESPACE::TensorProto::FLOAT16
Expand Down

0 comments on commit 0a8c3d1

Please sign in to comment.