Skip to content
This repository has been archived by the owner on May 22, 2023. It is now read-only.

Commit

Permalink
erase_to_well_defined should handle unbound shape vars in FuncStructInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
slyubomirsky committed Jan 9, 2023
1 parent 32c4090 commit 1da54d3
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions relax_spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -657,13 +657,17 @@ def erase_to_well_defined(
)
if s is FuncStructInfo:
if params is defined:
return FuncStructInfo(
params=[
erase_to_well_defined(param, var_scope, shape_var_scope)
for param in s.params
],
new_params = []
for param in s.params:
if param contains unbound shape variables:
insert unbound shape variables into shape_var_scope
new_params.append(erase_to_well_defined(param, var_scope, shape_var_scope))
ret = FuncStructInfo(
params=new_params,
ret=erase_to_well_defined(s.ret, var_scope, shape_var_scope)
)
remove any unbound shape variables added into shape_var_scope above
return ret
else:
return FuncStructInfo(
ret=erase_to_well_defined(s.ret, var_scope, shape_var_scope),
Expand Down

0 comments on commit 1da54d3

Please sign in to comment.