Skip to content

Commit

Permalink
Fixed inputs error for smoothquant example_inputs (#1473)
Browse files Browse the repository at this point in the history
Signed-off-by: Cheng, Penghui <penghui.cheng@intel.com>
  • Loading branch information
PenghuiCheng committed Dec 18, 2023
1 parent 33ece90 commit 39f63a8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion neural_compressor/adaptor/torch_utils/smooth_quant.py
Expand Up @@ -56,10 +56,11 @@ def move_input_to_device(input, device=torch.device("cpu")):
tmp_input[k] = move_input_to_device(inp, device)
input = tmp_input
elif isinstance(input, list) or isinstance(input, tuple):
is_tuple = isinstance(input, tuple)
tmp_input = []
for inp in input:
tmp_input.append(move_input_to_device(inp, device))
input = tmp_input
input = tuple(tmp_input) if is_tuple else tmp_input
elif isinstance(input, torch.Tensor):
input = input.to(device) # pylint: disable=no-member
return input
Expand Down

0 comments on commit 39f63a8

Please sign in to comment.