def forward(self, x: Tensor) -> Tuple[Tensor, Tensor, Tensor]: scale = self.scaling_impl(x) y = binary_sign_ste(x) * scale y = self.delay_wrapper(x, y) return y, scale, self.bit_width()
def forward(self, x: Tensor) -> Tuple[Tensor, Tensor, Tensor]: scale = self.scaling_impl(x) y = tensor_clamp(x, - scale, scale) y = binary_sign_ste(y) * scale return y, scale, self.bit_width()
def forward(self, x: Tensor, zero_hw_sentinel: Tensor) -> Tuple[Tensor, Tensor, Tensor]: scale = self.scaling_impl(zero_hw_sentinel) y = tensor_clamp(x, - scale, scale) y = binary_sign_ste(y) * scale return y, scale, zero_hw_sentinel + self.bit_width
def forward(self, x: Tensor) -> Tuple[Tensor, Tensor, Tensor, Tensor]: scale = self.scaling_impl(x) y = self.tensor_clamp_impl(x, - scale, scale) y = binary_sign_ste(y) * scale y = self.delay_wrapper(x, y) return y, scale, self.zero_point(), self.bit_width()