Skip to content

Commit

Permalink
Fix (fx/tracer): revert value tracer change (Xilinx#888)
Browse files Browse the repository at this point in the history
  • Loading branch information
Giuseppe5 authored Mar 1, 2024
1 parent 1b8ff28 commit b8a14ea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/brevitas/fx/value_tracer.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def retrieve_method_proxy(method_args, method_kwargs):
proxies: List[Proxy] = []

def find_proxy(a):
if isinstance(a, cls):
if isinstance(a, cls) and a not in proxies:
proxies.append(a)

fx.node.map_aggregate(method_args, find_proxy)
Expand All @@ -228,7 +228,7 @@ def find_proxy(a):
if torch.overrides.is_tensor_method_or_property(orig_method):
proxy = retrieve_method_proxy(args, kwargs)
try:
value = orig_method(*tracer.unpack_arg(args), **tracer.unpack_arg(kwargs))
value = proxy.value(*tracer.unpack_arg(args), **tracer.unpack_arg(kwargs))
except UnsetValueException:
value = _UNSET
return tracer.create_proxy(
Expand Down

0 comments on commit b8a14ea

Please sign in to comment.