Skip to content

Commit

Permalink
Update adaround_optimizer.py (#3709)
Browse files Browse the repository at this point in the history
Make sure that the input and output end up as tensors end up on the right device

Signed-off-by: Nikil Ragav <[email protected]>
  • Loading branch information
NikilXYZ authored Jan 13, 2025
1 parent b6c372d commit 72e22e9
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ def _optimize_rounding(cls, module: ModuleInfo, quantized_input_name,
else:
model_inputs = cached_dataset[np.random.randint(len(cached_dataset))]
inp_data, orig_out_data = act_sampler.sample_acts(create_input_dict(orig_model.model, model_inputs))
inp_data, orig_out_data = torch.from_numpy(inp_data[0]).to(torch_device), torch.from_numpy(out_data[0]).to(torch_device)
# This assumes there's only 1 input and 1 output in the list output by sample_acts


# Clear alpha's gradients before optimization step
Expand Down

0 comments on commit 72e22e9

Please sign in to comment.