From 39aabdb704f2177b68bd8896be1be62fc2c82a2f Mon Sep 17 00:00:00 2001 From: vmoens Date: Mon, 9 Oct 2023 17:32:06 +0100 Subject: [PATCH] amend --- tensordict/nn/params.py | 2 +- tensordict/tensordict.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tensordict/nn/params.py b/tensordict/nn/params.py index eb6ccb810..62917f5a8 100644 --- a/tensordict/nn/params.py +++ b/tensordict/nn/params.py @@ -424,7 +424,7 @@ def apply( ... @_unlock_and_set(inplace=True) - def _apply(*args, **kwargs): + def _apply_nest(*args, **kwargs): ... @_get_post_hook diff --git a/tensordict/tensordict.py b/tensordict/tensordict.py index c65f85ff7..de444bf16 100644 --- a/tensordict/tensordict.py +++ b/tensordict/tensordict.py @@ -5231,7 +5231,9 @@ def _empty_like(td: T, *args, **kwargs) -> T: "cloned, preventing empty_like to be called. " "Consider calling tensordict.to_tensordict() first." ) from err - return tdclone._fast_apply(lambda x: torch.empty_like(x, *args, **kwargs), inplace=True) + return tdclone._fast_apply( + lambda x: torch.empty_like(x, *args, **kwargs), inplace=True + ) @implements_for_td(torch.clone)