Skip to content

Commit

Permalink
Remove unused variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Giuseppe5 committed Dec 1, 2023
1 parent 98da0df commit 92fdeae
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/brevitas/core/quant/delay.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def __init__(self, quant_delay_steps):
super(_DelayQuant, self).__init__()
self.quant_delay_steps: int = brevitas.jit.Attribute(quant_delay_steps, int)

@brevitas.jit.script_method_110_disabled
@brevitas.jit.script_method
def forward(self, x: Tensor, y: Tensor) -> Tensor:
if self.quant_delay_steps > 0:
self.quant_delay_steps = self.quant_delay_steps - 1
Expand Down
4 changes: 2 additions & 2 deletions src/brevitas/core/quant/int_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def __init__(
self.narrow_range = narrow_range
self.delay_wrapper = DelayWrapper(quant_delay_steps)

@brevitas.jit.script_method_110_disabled
@brevitas.jit.script_method
def to_int(self, scale: Tensor, zero_point: Tensor, bit_width: Tensor, x: Tensor) -> Tensor:
y = x / scale
y = y + zero_point
Expand Down Expand Up @@ -134,7 +134,7 @@ def __init__(
self.narrow_range = narrow_range
self.delay_wrapper = DelayWrapper(quant_delay_steps)

@brevitas.jit.script_method_110_disabled
@brevitas.jit.script_method
def to_int(
self, pre_scale: Tensor, pre_zero_point: Tensor, bit_width: Tensor,
x: Tensor) -> Tensor:
Expand Down
3 changes: 0 additions & 3 deletions src/brevitas/jit.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Copyright (C) 2023, Advanced Micro Devices, Inc. All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause

from packaging import version
import torch

from brevitas.config import JIT_ENABLED
Expand All @@ -17,12 +16,10 @@ def _disabled(fn):
script = torch.jit.script
ScriptModule = torch.jit.ScriptModule
Attribute = torch.jit.Attribute
script_method_110_disabled = script_method

else:

script_method = _disabled
script = _disabled
script_method_110_disabled = _disabled
ScriptModule = torch.nn.Module
Attribute = lambda val, type: val

0 comments on commit 92fdeae

Please sign in to comment.