Skip to content

Commit

Permalink
fix: Fix to handle_transpose_in_input_and_output_for_functions decora…
Browse files Browse the repository at this point in the history
…tor to correctly propagate the currently set data format to subsequent calls and reset it once we exit from those calls
  • Loading branch information
hmahmood24 committed Sep 13, 2024
1 parent 429fae0 commit c9ad12b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ivy/utils/decorator_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,8 +432,11 @@ def transpose_wrapper(*args, **kwargs):
kwargs["data_format"] = value_map[kwargs["data_format"]]
if "filter_format" in kwargs and kwargs["filter_format"] in value_map:
kwargs["filter_format"] = value_map[kwargs["filter_format"]]
os.environ["DATA_FORMAT"] = "channels_last"

return fn(*args, **kwargs)
res = fn(*args, **kwargs)
os.environ["DATA_FORMAT"] = DATA_FORMAT
return res

return transpose_wrapper

Expand Down

0 comments on commit c9ad12b

Please sign in to comment.