Skip to content

Commit

Permalink
Fix type constraints of Reshape(19) (onnx#5146)
Browse files Browse the repository at this point in the history
Signed-off-by: xadupre <xadupre@microsoft.com>
Signed-off-by: Yuan Yao <yuanyao@nvidia.com>
  • Loading branch information
xadupre authored and yuanyao-nv committed Apr 26, 2023
1 parent 8278d7f commit e1fc0ba
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/Changelog.md
Expand Up @@ -23461,7 +23461,7 @@ This version of the operator has been available since version 19 of the default
#### Type Constraints

<dl>
<dt><tt>T</tt> : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128)</dt>
<dt><tt>T</tt> : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128), tensor(float8e4m3fn), tensor(float8e4m3fnuz), tensor(float8e5m2), tensor(float8e5m2fnuz)</dt>
<dd>Constrain input and output types to all tensor types.</dd>
</dl>

Expand Down
2 changes: 1 addition & 1 deletion docs/Operators.md
Expand Up @@ -21692,7 +21692,7 @@ Other versions of this operator: <a href="Changelog.md#Reshape-1">1</a>, <a href
#### Type Constraints

<dl>
<dt><tt>T</tt> : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128)</dt>
<dt><tt>T</tt> : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128), tensor(float8e4m3fn), tensor(float8e4m3fnuz), tensor(float8e5m2), tensor(float8e5m2fnuz)</dt>
<dd>Constrain input and output types to all tensor types.</dd>
</dl>

Expand Down
6 changes: 3 additions & 3 deletions onnx/defs/tensor/defs.cc
Expand Up @@ -261,7 +261,7 @@ ONNX_OPERATOR_SET_SCHEMA(
return true;
}));

static const char* Reshape_ver14_doc = R"DOC(
static const char* Reshape_ver19_doc = R"DOC(
Reshape the input tensor similar to numpy.reshape.
First input is the data tensor, second input is a shape tensor which specifies the output shape. It outputs the reshaped tensor.
At most one dimension of the new shape can be -1. In this case, the value is
Expand All @@ -281,7 +281,7 @@ ONNX_OPERATOR_SET_SCHEMA(
Reshape,
19,
OpSchema()
.SetDoc(Reshape_ver14_doc)
.SetDoc(Reshape_ver19_doc)
.Attr(
"allowzero",
"(Optional) By default, when any value in the 'shape' input is equal to zero "
Expand All @@ -301,7 +301,7 @@ ONNX_OPERATOR_SET_SCHEMA(
1,
OpSchema::NonDifferentiable)
.Output(0, "reshaped", "Reshaped data.", "T", OpSchema::Single, true, 1, OpSchema::Differentiable)
.TypeConstraint("T", OpSchema::all_tensor_types_ir4(), "Constrain input and output types to all tensor types.")
.TypeConstraint("T", OpSchema::all_tensor_types_ir9(), "Constrain input and output types to all tensor types.")
.TypeAndShapeInferenceFunction([](InferenceContext& ctx) {
// Type inference
propagateElemTypeFromInputToOutput(ctx, 0, 0);
Expand Down

0 comments on commit e1fc0ba

Please sign in to comment.