Rename second input dimension from "sequence" to "num_channels" for CV models (#17976)
This commit is contained in:
@@ -194,7 +194,7 @@ class BeitOnnxConfig(OnnxConfig):
|
|||||||
def inputs(self) -> Mapping[str, Mapping[int, str]]:
|
def inputs(self) -> Mapping[str, Mapping[int, str]]:
|
||||||
return OrderedDict(
|
return OrderedDict(
|
||||||
[
|
[
|
||||||
("pixel_values", {0: "batch", 1: "sequence"}),
|
("pixel_values", {0: "batch", 1: "num_channels"}),
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ class ConvNextOnnxConfig(OnnxConfig):
|
|||||||
def inputs(self) -> Mapping[str, Mapping[int, str]]:
|
def inputs(self) -> Mapping[str, Mapping[int, str]]:
|
||||||
return OrderedDict(
|
return OrderedDict(
|
||||||
[
|
[
|
||||||
("pixel_values", {0: "batch", 1: "sequence"}),
|
("pixel_values", {0: "batch", 1: "num_channels"}),
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -193,7 +193,7 @@ class Data2VecVisionOnnxConfig(OnnxConfig):
|
|||||||
def inputs(self) -> Mapping[str, Mapping[int, str]]:
|
def inputs(self) -> Mapping[str, Mapping[int, str]]:
|
||||||
return OrderedDict(
|
return OrderedDict(
|
||||||
[
|
[
|
||||||
("pixel_values", {0: "batch", 1: "sequence"}),
|
("pixel_values", {0: "batch", 1: "num_channels"}),
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ class DeiTOnnxConfig(OnnxConfig):
|
|||||||
def inputs(self) -> Mapping[str, Mapping[int, str]]:
|
def inputs(self) -> Mapping[str, Mapping[int, str]]:
|
||||||
return OrderedDict(
|
return OrderedDict(
|
||||||
[
|
[
|
||||||
("pixel_values", {0: "batch", 1: "sequence"}),
|
("pixel_values", {0: "batch", 1: "num_channels"}),
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -220,8 +220,8 @@ class DetrOnnxConfig(OnnxConfig):
|
|||||||
def inputs(self) -> Mapping[str, Mapping[int, str]]:
|
def inputs(self) -> Mapping[str, Mapping[int, str]]:
|
||||||
return OrderedDict(
|
return OrderedDict(
|
||||||
[
|
[
|
||||||
("pixel_values", {0: "batch", 1: "sequence"}),
|
("pixel_values", {0: "batch", 1: "num_channels"}),
|
||||||
("pixel_mask", {0: "batch", 1: "sequence"}),
|
("pixel_mask", {0: "batch"}),
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -212,7 +212,7 @@ class LayoutLMv3OnnxConfig(OnnxConfig):
|
|||||||
("input_ids", {0: "batch", 1: "sequence"}),
|
("input_ids", {0: "batch", 1: "sequence"}),
|
||||||
("bbox", {0: "batch", 1: "sequence"}),
|
("bbox", {0: "batch", 1: "sequence"}),
|
||||||
("attention_mask", {0: "batch", 1: "sequence"}),
|
("attention_mask", {0: "batch", 1: "sequence"}),
|
||||||
("pixel_values", {0: "batch", 1: "sequence"}),
|
("pixel_values", {0: "batch", 1: "num_channels"}),
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ class MobileViTOnnxConfig(OnnxConfig):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def inputs(self) -> Mapping[str, Mapping[int, str]]:
|
def inputs(self) -> Mapping[str, Mapping[int, str]]:
|
||||||
return OrderedDict([("pixel_values", {0: "batch"})])
|
return OrderedDict([("pixel_values", {0: "batch", 1: "num_channels"})])
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def outputs(self) -> Mapping[str, Mapping[int, str]]:
|
def outputs(self) -> Mapping[str, Mapping[int, str]]:
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ class ResNetOnnxConfig(OnnxConfig):
|
|||||||
def inputs(self) -> Mapping[str, Mapping[int, str]]:
|
def inputs(self) -> Mapping[str, Mapping[int, str]]:
|
||||||
return OrderedDict(
|
return OrderedDict(
|
||||||
[
|
[
|
||||||
("pixel_values", {0: "batch", 1: "sequence"}),
|
("pixel_values", {0: "batch", 1: "num_channels"}),
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ class ViTOnnxConfig(OnnxConfig):
|
|||||||
def inputs(self) -> Mapping[str, Mapping[int, str]]:
|
def inputs(self) -> Mapping[str, Mapping[int, str]]:
|
||||||
return OrderedDict(
|
return OrderedDict(
|
||||||
[
|
[
|
||||||
("pixel_values", {0: "batch", 1: "sequence"}),
|
("pixel_values", {0: "batch", 1: "num_channels"}),
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -199,6 +199,7 @@ PYTORCH_EXPORT_MODELS = {
|
|||||||
("roformer", "junnyu/roformer_chinese_base"),
|
("roformer", "junnyu/roformer_chinese_base"),
|
||||||
("squeezebert", "squeezebert/squeezebert-uncased"),
|
("squeezebert", "squeezebert/squeezebert-uncased"),
|
||||||
("mobilebert", "google/mobilebert-uncased"),
|
("mobilebert", "google/mobilebert-uncased"),
|
||||||
|
("mobilevit", "apple/mobilevit-small"),
|
||||||
("xlm", "xlm-clm-ende-1024"),
|
("xlm", "xlm-clm-ende-1024"),
|
||||||
("xlm-roberta", "xlm-roberta-base"),
|
("xlm-roberta", "xlm-roberta-base"),
|
||||||
("layoutlm", "microsoft/layoutlm-base-uncased"),
|
("layoutlm", "microsoft/layoutlm-base-uncased"),
|
||||||
|
|||||||
Reference in New Issue
Block a user