Add int64 as a required type to ConstantOfShape as it's used by the pytorch converter for Pad. (#8128)

It's also used pointlessly for torch.tensor.repeat (although that usage should always be able to be constant folded).
This commit is contained in:
Scott McKay 2021-06-23 14:53:06 +10:00 committed by GitHub
parent b1e21312b5
commit cccd61e3bc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -10,7 +10,13 @@ namespace op_kernel_type_control {
ORT_SPECIFY_OP_KERNEL_ARG_DEFAULT_TYPE_LIST_ALL_OPSETS(
kCpuExecutionProvider, kOnnxDomain, ConstantOfShape, Output, 0,
ConstantOfShapeDefaultOutputTypes);
}
// pytorch converter uses ConstantOfShape with int64 to create Pad input
// https://github.com/pytorch/pytorch/blob/044b519a80459f6787f6723c1c091a18b153d184/torch/onnx/symbolic_opset11.py#L449
ORT_SPECIFY_OP_KERNEL_ARG_REQUIRED_TYPES_ALL_OPSETS(
kCpuExecutionProvider, kOnnxDomain, ConstantOfShape, Output, 0,
int64_t);
} // namespace op_kernel_type_control
namespace {