Skip to content

Commit

Permalink
clena up
Browse files Browse the repository at this point in the history
Signed-off-by: Masaki Kozuki <mkozuki@nvidia.com>
  • Loading branch information
crcrpar committed Jun 16, 2024
1 parent 0dc8cf0 commit 2f3f467
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions thunder/core/transform_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ def is_inplace(bsym: BoundSymbol) -> bool:
copy_out = copy_bsym.flat_proxy_outs[0]
copy_dst = copy_bsym.flat_proxy_args[1]
swap_map[variableify(copy_dst)] = copy_out
# Remove `prims.copy_`
# make sure an in-place bsym returns `prims.copy_` output
new_bsym = new_bsym.from_bsym_swap_proxies(swap_map, skip_inputs=True, skip_subsymbols=True)
bsyms.append(new_bsym)

Expand All @@ -428,7 +428,6 @@ def is_inplace(bsym: BoundSymbol) -> bool:
for bsym in intermediate_trace.bound_symbols:
new_bsym = bsym.from_bsym_swap_proxies(swap_map)

# in-place ops has `prims.copy_` as the last subsymbol.
if not is_inplace(new_bsym):
new_bsyms.append(new_bsym)
continue
Expand Down

0 comments on commit 2f3f467

Please sign in to comment.