haojin2 commented on a change in pull request #17904: [Numpy] add: numpy op
trilindices
URL: https://github.com/apache/incubator-mxnet/pull/17904#discussion_r400589755
##########
File path: python/mxnet/numpy/multiarray.py
##########
@@ -5533,6 +5533,87 @@ def tril(m, k=0):
"""
return _mx_nd_np.tril(m, k)
+@set_module('mxnet.numpy')
+def tril_indices(n, k=0, m=None):
+ """
+ Return the indices for the lower-triangle of an (n, m) array.
+
+ Parameters
+ ----------
+ n : int
+ The row dimension of the arrays for which the returned
+ indices will be valid.
+ k : int, optional
+ Diagonal offset (see `tril` for details).
+ m : int, optional
+ .. versionadded:: 1.9.0
+
+ The column dimension of the arrays for which the returned
+ arrays will be valid.
+ By default `m` is taken equal to `n`.
+
+
+ Returns
+ -------
+ inds : tuple of arrays
+ The indices for the triangle. The returned tuple contains two arrays,
+ each with the indices along one dimension of the array.
+
+ See also
+ --------
+ triu_indices : similar function, for upper-triangular.
+ mask_indices : generic function accepting an arbitrary mask function.
+ tril, triu
+
+ Notes
+ -----
+ .. versionadded:: 1.4.0
Review comment:
no need for `Notes` section
----------------------------------------------------------------
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