Skip to content
Snippets Groups Projects
Commit f87edabd authored by Oscar Gustafsson's avatar Oscar Gustafsson :bicyclist:
Browse files

Fix fwl simulation

parent 244fa3a7
No related branches found
No related tags found
1 merge request!275Fix fwl simulation
Pipeline #93756 passed
......@@ -928,14 +928,13 @@ class AbstractOperation(Operation, AbstractGraphComponent):
)
return self.input(0)
# TODO: Fix
def quantize_input(self, index: int, value: Num, bits: int) -> Num:
if isinstance(value, (float, int)):
return round(value) & ((2**bits) - 1)
b = 2**bits
return round((value + 1) * b % (2 * b) - b) / b
else:
raise TypeError
# TODO: Seems wrong??? - Oscar
def quantize_inputs(
self,
input_values: Sequence[Num],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment