kaknikhil commented on a change in pull request #443: DL: Add training for 
multiple models
URL: https://github.com/apache/madlib/pull/443#discussion_r326735933
 
 

 ##########
 File path: 
src/ports/postgres/modules/deep_learning/madlib_keras_serializer.py_in
 ##########
 @@ -155,6 +159,13 @@ def deserialize_as_nd_weights(model_weights_serialized, 
model_shapes):
 
     i, j, model_weights = 0, 0, []
     model_weights_serialized = np.fromstring(model_weights_serialized, 
dtype=np.float32)
+
+    total_model_shape = \
+        sum([reduce(lambda x, y: x * y, ls) for ls in model_shapes])
+    total_weights_shape = model_weights_serialized.size
+    _assert(total_model_shape == total_weights_shape,
 
 Review comment:
   We have a unit test for the`deserialize_as_nd_weights`. Can we update it to 
test for this assertion?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to