Skip to content

Commit 527d301

Browse files
committed
revert old pt fix
xfail for known issue pre-commit fix
1 parent ee50c4f commit 527d301

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

nncf/torch/dynamic_graph/trace_tensor.py

-2
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,6 @@ def from_torch_tensor(tensor: torch.Tensor, tensor_meta: Optional[TensorMeta] =
117117
:param tensor_meta: The metadata associated with the tensor.
118118
:return: The resulting TracedTensor.
119119
"""
120-
if tensor.dim() == 0:
121-
tensor = torch.unsqueeze(tensor, 0)
122120
return TracedTensor.patch(tensor, tensor_meta)
123121

124122
def as_subclass(self, cls: "TracedTensor") -> "TracedTensor":

tests/torch/sparsity/movement/test_model_saving.py

+17-11
Original file line numberDiff line numberDiff line change
@@ -95,17 +95,23 @@ def test_no_weight_override_on_export(self, tmp_path):
9595
SwinRunRecipe(),
9696
LinearRunRecipe(),
9797
Conv2dPlusLinearRunRecipe(),
98-
SwinRunRecipe()
99-
.scheduler_params_(enable_structured_masking=False)
100-
.model_config_(
101-
image_size=384,
102-
patch_size=4,
103-
window_size=12,
104-
embed_dim=192,
105-
mlp_ratio=4,
106-
depths=(2, 2, 5, 2),
107-
num_heads=(6, 12, 24, 48),
108-
num_labels=32,
98+
pytest.param(
99+
SwinRunRecipe()
100+
.scheduler_params_(enable_structured_masking=False)
101+
.model_config_(
102+
image_size=384,
103+
patch_size=4,
104+
window_size=12,
105+
embed_dim=192,
106+
mlp_ratio=4,
107+
depths=(2, 2, 5, 2),
108+
num_heads=(6, 12, 24, 48),
109+
num_labels=32,
110+
),
111+
marks=pytest.mark.xfail(
112+
reason="""transformers>=4.47.0 swin model causes an error calling torch.tensor on
113+
(TracedTensor,) Ticket 162383"""
114+
),
109115
),
110116
],
111117
)

0 commit comments

Comments
 (0)