matrix.py 文件源码

python
阅读 40 收藏 0 点赞 0 评论 0

项目:paysage 作者: drckf 项目源码 文件源码
def tall(x: T.Tensor,
         axis: int = None,
         keepdims: bool = False) -> T.Boolean:
    """
    Return True if all elements of the input tensor are true along the
    specified axis.

    Args:
        x: A float or tensor.
        axis (optional): The axis of interest.
        keepdims (optional): If this is set to true, the dimension of the tensor
                             is unchanged. Otherwise, the reduced axis is removed
                             and the dimension of the array is 1 less.

    Returns:
        if axis is None:
            bool: 'all' applied to all elements in the tensor
        else:
            tensor (of bytes): 'all' applied to the elements in the tensor
                                along axis

    """
    return tmin(x.ne(0), axis=axis, keepdims=keepdims)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号