mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-30 20:18:08 +00:00
Add type inference for BroadcastGradientArgs (#5501)
* Add type inference for BroadcastGradientArgs
This change enables the ONNX shape and type inference to work on a function body containing a BroadcastGradientArgs op. Without this change, the dummy inference function is used, and no types are inferred for the output here:
531e6dd459/onnx/shape_inference/implementation.cc (L467-L469)
* Handle optional outputs.
This commit is contained in:
parent
7da7e07909
commit
88f6523baf
1 changed files with 7 additions and 1 deletions
|
|
@ -1433,7 +1433,13 @@ Example 4:
|
|||
.TypeConstraint(
|
||||
"T",
|
||||
{"tensor(int64)"},
|
||||
"Constrain input and output types to 64-bit integer.");
|
||||
"Constrain input and output types to 64-bit integer.")
|
||||
.TypeAndShapeInferenceFunction([](ONNX_NAMESPACE::InferenceContext& ctx) {
|
||||
// NOTE: Both outputs are optional.
|
||||
for (size_t i = 0; i < ctx.getNumOutputs(); ++i) {
|
||||
updateOutputElemType(ctx, i, ONNX_NAMESPACE::TensorProto::INT64);
|
||||
}
|
||||
});
|
||||
|
||||
ONNX_CONTRIB_OPERATOR_SCHEMA(GistBinarizeEncoder)
|
||||
.SetDomain(kMSDomain)
|
||||
|
|
|
|||
Loading…
Reference in a new issue