Skip to content

Commit

Permalink
helpers: fix immutable arguments conversion into mutables (ivy-llc#4983)
Browse files Browse the repository at this point in the history
  • Loading branch information
hmahmood24 authored Oct 4, 2022
1 parent cd05df9 commit 1eccaa8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ivy_tests/test_ivy/helpers/function_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ def test_function(
break
instance_idx = args_idxs[i]
instance = ivy.index_nest(args, instance_idx)
args = ivy.copy_nest(args, to_mutable=True)
args = ivy.copy_nest(args, to_mutable=False)
ivy.prune_nest_at_index(args, instance_idx)
else:
i = 0
Expand All @@ -255,7 +255,7 @@ def test_function(
break
instance_idx = kwargs_idxs[i]
instance = ivy.index_nest(kwargs, instance_idx)
kwargs = ivy.copy_nest(kwargs, to_mutable=True)
kwargs = ivy.copy_nest(kwargs, to_mutable=False)
ivy.prune_nest_at_index(kwargs, instance_idx)
if test_unsupported:
test_unsupported_function(
Expand Down Expand Up @@ -1702,7 +1702,7 @@ def create_args_kwargs(
as_cont(x=x) if c else x
for x, c in zip(arg_array_vals, container_flags[:num_arg_vals])
]
args = ivy.copy_nest(args_np, to_mutable=True)
args = ivy.copy_nest(args_np, to_mutable=False)
ivy.set_nest_at_indices(args, args_idxs, arg_array_vals)

# create kwargs
Expand All @@ -1724,7 +1724,7 @@ def create_args_kwargs(
as_cont(x=x) if c else x
for x, c in zip(kwarg_array_vals, container_flags[num_arg_vals:])
]
kwargs = ivy.copy_nest(kwargs_np, to_mutable=True)
kwargs = ivy.copy_nest(kwargs_np, to_mutable=False)
ivy.set_nest_at_indices(kwargs, kwargs_idxs, kwarg_array_vals)
return args, kwargs, num_arg_vals, args_idxs, kwargs_idxs

Expand Down

0 comments on commit 1eccaa8

Please sign in to comment.