Turn onnx functions into static (#147598)

To avoid exposing ONNX symbols.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/147598
Approved by: https://github.com/justinchuby
This commit is contained in:
cyy 2025-02-21 07:40:28 +00:00 committed by PyTorch MergeBot
parent 3395da7f7c
commit b61a556427

View File

@ -414,7 +414,7 @@ class GraphEncoder {
static constexpr size_t ParamSizeThresholdForExternalStorage = 1024; static constexpr size_t ParamSizeThresholdForExternalStorage = 1024;
}; };
onnx::TensorProto_DataType ATenTypeToOnnxType(at::ScalarType at_type) { static onnx::TensorProto_DataType ATenTypeToOnnxType(at::ScalarType at_type) {
switch (at_type) { switch (at_type) {
case at::kDouble: case at::kDouble:
return onnx::TensorProto_DataType_DOUBLE; return onnx::TensorProto_DataType_DOUBLE;
@ -459,7 +459,7 @@ onnx::TensorProto_DataType ATenTypeToOnnxType(at::ScalarType at_type) {
} }
} }
onnx::AttributeProto_AttributeType ATenAttributeKindToOnnxAttributeType( static onnx::AttributeProto_AttributeType ATenAttributeKindToOnnxAttributeType(
AttributeKind at_kind, AttributeKind at_kind,
const jit::Symbol name) { const jit::Symbol name) {
switch (at_kind) { switch (at_kind) {