Skip to content
Snippets Groups Projects

Add support for namespaced attributes in DynamicAttributes

Merged Olivier BICHLER requested to merge attr_ns into dev
2 files
+ 18
0
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -100,6 +100,23 @@ class test_operator_binding(unittest.TestCase):
attrs.d = 23.89
self.assertEqual(aidge_core.test_DynamicAttributes_binding_check(attrs), 23.89)
op = aidge_core.GenericOperatorOp("any_type", 1,0,1)
with self.assertRaises(RuntimeError):
op.attr.something
op.attr.something = aidge_core.DynamicAttributes()
try:
self.assertEqual(str(op.attr), "AttrDict({'something': AttrDict({})})")
except Exception:
self.fail("op.attr.something raised Exception unexpectedly!")
op.attr.something.arg1 = 4
self.assertEqual(op.attr.something.arg1, 4)
# auto create the namespace another_thing (not enabled)
#op.attr.another_thing.arg = 44
#self.assertEqual(op.attr.another_thing.arg, 44)
def test_forward_dims(self):
in_dims=[25, 25]
input = aidge_core.Producer(in_dims, name="In")
Loading