Skip to content

Commit

Permalink
Fix (graph/gpxq): fix orig_forward assignment (Xilinx#845)
Browse files Browse the repository at this point in the history
  • Loading branch information
Giuseppe5 authored Feb 13, 2024
1 parent 86304bc commit cf37912
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/brevitas/graph/gpxq.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,10 @@ def __init__(
self.group_of_parallel_layers = group_of_parallel_layers
self.return_forward_output = return_forward_output

self.orig_forward = self.model.forward
if isinstance(self.model, (GraphModule, TorchGraphModule)):
self.orig_forward = self.model.__class__.forward
self.model.__class__.forward = self.catch_stopfwd
else:
self.orig_forward = self.model.forward
self.model.forward = self.catch_stopfwd

def _is_module_supported(self, module):
Expand Down

0 comments on commit cf37912

Please sign in to comment.