(qmin, qmax, inp, step_size, zero_point=None, scale_grad=None)
| 36 | |
| 37 | |
| 38 | def lsq_forward(qmin, qmax, inp, step_size, zero_point=None, scale_grad=None): |
| 39 | if zero_point is None: |
| 40 | zero_point = Tensor([0.0], dtype=np.float32) |
| 41 | if scale_grad is None: |
| 42 | scale_grad = Tensor([1.0], dtype=np.float32) |
| 43 | op = builtin.LSQ(qmin=qmin, qmax=qmax) |
| 44 | (output,) = apply(op, inp, step_size, zero_point, scale_grad) |
| 45 | return output |
| 46 | |
| 47 | |
| 48 | def register_method_to_class(cls): |