Skip to content

Commit bba04d4

Browse files
committed
Tweak error message
1 parent 4e250e6 commit bba04d4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

torchrl/collectors/collectors.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,11 @@ def _policy_is_tensordict_compatible(policy: nn.Module):
105105
# that will have undetermined behaviour, we raise an error
106106
raise TypeError(
107107
"Received a policy that defines in_keys or out_keys and also expects multiple "
108-
"arguments to self.forward. If the policy is compatible with TensorDict, it "
109-
"should take a single argument of type TensorDict to self.forward and define "
110-
"both in_keys and out_keys. Alternatively, self.forward can accept arbitrarily "
111-
"many tensor inputs and leave in_keys and out_keys undefined and TorchRL will "
112-
"attempt to automatically wrap the policy with a TensorDictModule."
108+
"arguments to policy.forward. If the policy is compatible with TensorDict, it "
109+
"should take a single argument of type TensorDict to policy.forward and define "
110+
"both in_keys and out_keys. Alternatively, policy.forward can accept "
111+
"arbitrarily many tensor inputs and leave in_keys and out_keys undefined and "
112+
"TorchRL will attempt to automatically wrap the policy with a TensorDictModule."
113113
)
114114

115115

0 commit comments

Comments
 (0)