Skip to content

Commit

Permalink
added code to turn value into tensor if not already
Browse files Browse the repository at this point in the history
  • Loading branch information
costigt-dev committed May 1, 2024
1 parent 165b8de commit 0428c34
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/brevitas/nn/mixin/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ def unpack_input(self, inp: Union[Tensor, QuantTensor]) -> Union[Tensor, QuantTe
if not torch._C._get_tracing_state():
if isinstance(inp, QuantTensor):
inp = inp.set(value=inp.value.rename(None))
elif isinstance(inp, Tensor):
else:
if isinstance(inp, Tensor) is False:
inp = torch.tensor(inp)
inp = inp.rename(None)
return inp

Expand Down

0 comments on commit 0428c34

Please sign in to comment.