MCPcopy Create free account
hub / github.com/NVIDIA/DALI / TestClass

Class TestClass

dali/test/python/autograph/impl/test_api.py:146–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

144
145 def test_decorator_recursive(self):
146 class TestClass(object):
147 def called_member(self, a):
148 if a < 0:
149 a = -a
150 return a
151
152 @api.convert(recursive=True)
153 def test_method(self, x, s, a):
154 while reduce(add, x) > s:
155 x //= self.called_member(a)
156 return x
157
158 tc = TestClass()
159 x = tc.test_method(custom_constant([2, 4]), custom_constant(1), custom_constant(-2))

Calls

no outgoing calls