juliale-15 commented on a change in pull request #892:
URL: https://github.com/apache/systemml/pull/892#discussion_r411258521



##########
File path: src/main/python/systemds/context/systemds_context.py
##########
@@ -164,4 +164,14 @@ def rand(self, rows: int, cols: int, min: Union[float, 
int] = None,
         :param lambd: lamda value for "poison" distribution
         :return:
         """
+        available_pdfs = ["uniform", "normal", "poisson"]
+        if rows < 0:
+            raise ValueError("In rand statement, can only assign rows a long 
(integer) value >= 0 "
+                            "-- attempted to assign value: {r}".format(r=rows))
+        if cols < 0:
+            raise ValueError("In rand statement, can only assign cols a long 
(integer) value >= 0 "

Review comment:
       I did not include the zero case because `np.random.randint(0,1,(0,0))` 
is a valid call. And `sds.rand(0,0)` returns the same output (an empty numpy 
array). Should I change the condition anyways?




----------------------------------------------------------------
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]


Reply via email to