Skip to content

Commit

Permalink
Merge pull request #2473 from jermainewang/master
Browse files Browse the repository at this point in the history
Add minimum operator
  • Loading branch information
jermainewang authored Jun 20, 2016
2 parents ed8fa53 + 560c312 commit ba57aa9
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions python/mxnet/ndarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,32 @@ def maximum(lhs, rhs):
None)
# pylint: enable= no-member, protected-access

def minimum(lhs, rhs):
""" Perform minimum operator
Parameters
----------
lhs : Array or float value
left hand side operand
rhs : Array of float value
right hand side operand
Returns
-------
out: Array
result array
"""
# pylint: disable= no-member, protected-access
return _ufunc_helper(
lhs,
rhs,
NDArray._minimum,
lambda x, y: x if x < y else y,
NDArray._minimum_scalar,
None)
# pylint: enable= no-member, protected-access

def true_divide(lhs, rhs):
""" Same as numpy's true_divide. It adjusts the output type to present the best answer,
regardless of input types.
Expand Down

0 comments on commit ba57aa9

Please sign in to comment.