We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 478cffe + f791354 commit 1a96148Copy full SHA for 1a96148
tests/linen/linen_transforms_test.py
@@ -1026,6 +1026,19 @@ def _helper(self):
1026
with self.assertRaises(errors.TransformedMethodReturnValueError):
1027
b.apply({}, jnp.ones(2))
1028
1029
+ def test_returned_variable_warning(self):
1030
+ class Bar(nn.Module):
1031
+ @nn.compact
1032
+ def __call__(self, x):
1033
+ f = self._helper()
1034
+ return f(x)
1035
+ @nn.jit
1036
+ def _helper(self):
1037
+ return nn.Variable(None, None, None)
1038
+ b = Bar()
1039
+ with self.assertRaises(errors.TransformedMethodReturnValueError):
1040
+ b.apply({}, jnp.ones(2))
1041
+
1042
def test_nowrap(self):
1043
class Bar(nn.Module):
1044
@nn.compact
0 commit comments