Skip to content
Snippets Groups Projects

Unified interface for attributes

Merged Olivier BICHLER requested to merge unified_params into main
3 files
+ 9
9
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -27,21 +27,21 @@ class test_parameters(unittest.TestCase):
out_channels = 8
k_dims = [2, 2]
conv_op = aidge_core.Conv2D(in_channels , out_channels, k_dims).get_operator()
self.assertEqual(conv_op.get("InChannels"), in_channels)
self.assertEqual(conv_op.get("OutChannels"), out_channels)
self.assertEqual(conv_op.get("KernelDims"), k_dims)
self.assertEqual(conv_op.get_parameter("InChannels"), in_channels)
self.assertEqual(conv_op.get_parameter("OutChannels"), out_channels)
self.assertEqual(conv_op.get_parameter("KernelDims"), k_dims)
def test_fc(self):
out_channels = 8
nb_bias = True
fc_op = aidge_core.FC(out_channels, nb_bias).get_operator()
self.assertEqual(fc_op.get("OutChannels"), out_channels)
self.assertEqual(fc_op.get("NoBias"), nb_bias)
self.assertEqual(fc_op.get_parameter("OutChannels"), out_channels)
self.assertEqual(fc_op.get_parameter("NoBias"), nb_bias)
def test_matmul(self):
out_channels = 8
matmul_op = aidge_core.Matmul(out_channels).get_operator()
self.assertEqual(matmul_op.get("OutChannels"), out_channels)
self.assertEqual(matmul_op.get_parameter("OutChannels"), out_channels)
def test_producer_1D(self):
dims = [5]
@@ -71,7 +71,7 @@ class test_parameters(unittest.TestCase):
def test_leaky_relu(self):
negative_slope = 0.25
leakyrelu_op = aidge_core.LeakyReLU(negative_slope).get_operator()
self.assertEqual(leakyrelu_op.get("NegativeSlope"), negative_slope)
self.assertEqual(leakyrelu_op.get_parameter("NegativeSlope"), negative_slope)
if __name__ == '__main__':
unittest.main()
Loading