Baunsgaard commented on a change in pull request #892: Extend Python API (rand,
lm, matrix multiplication)
URL: https://github.com/apache/systemml/pull/892#discussion_r410876115
##########
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:
`if cols <= 0:`
`In rand statement, can only assign cols a long (integer) value > 0 `
not >=0
This makes me think that you did not verify the edge case of 0. Other than
that, the message looks good :smile:
----------------------------------------------------------------
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