示例#1
0
def argmax(input, axis=None, name=None, dimension=None):

    if dimension is not None:
        if axis is not None:
            raise ValueError("cannot specify both 'axis' and 'dimension'.")
        axis = dimension
    elif axis is None: axis = 0
    return ops.Argmax(input, axis=axis, name=name)
示例#2
0
文件: basic.py 项目: k9sret/Dragon
def argmax(x, axis=None, keepdims=False):
    """Compute the indices of maximum elements along the given axis.

    Parameters
    ----------
    x : Tensor
        The input tensor.
    axis : int
        The axis to compute. Default is ``None`` (Along all axes).
    keep_dims : boolean
        Whether to keep dims after computing.

    Returns
    -------
    Tensor
        The indices.

    """
    if axis is None: axis = -1
    return ops.Argmax(x, axis=axis, keep_dims=keepdims)
示例#3
0
 def Setup(self, bottom):
     super(ArgMaxLayer, self).Setup(bottom)
     input = bottom[0] if isinstance(bottom, list) else bottom
     return ops.Argmax(input, **self._param)