Ejemplo n.º 1
0
 def output_symbolic_execution(self, out: Tensor):
     output_quant_symbolic_kwargs = self.symbolic_kwargs['output_quant_symbolic_kwargs']
     output_dequant_symbolic_kwargs = self.symbolic_kwargs['output_dequant_symbolic_kwargs']
     out = QuantizeLinearFn.apply(out, *output_quant_symbolic_kwargs.values())
     if output_dequant_symbolic_kwargs is not None:
         out = DequantizeLinearFn.apply(out, *output_dequant_symbolic_kwargs.values())
     return out
Ejemplo n.º 2
0
 def input_symbolic_execution(self, inp: Tensor):
     input_quant_symbolic_kwargs = self.symbolic_kwargs['input_quant_symbolic_kwargs']
     input_dequant_symbolic_kwargs = self.symbolic_kwargs['input_dequant_symbolic_kwargs']
     if input_dequant_symbolic_kwargs is not None:
         assert input_quant_symbolic_kwargs is not None
         inp = DequantizeLinearFn.apply(inp, *input_dequant_symbolic_kwargs.values())
     if input_quant_symbolic_kwargs is not None:
         inp = QuantizeLinearFn.apply(inp, *input_quant_symbolic_kwargs.values())
     return inp