(self, indices, axis=None)
return self.__class__(
            backend=self.backend,
            ary=self._tensor.take(indices, axis).reshape(new_shape),
            dtype=self._tensor.dtype,
            base=self)
Select a subset of elements from an array across an axis.

        Arguments:
            indices (Tensor, numpy ndarray): indicies of elements to select
            axis (int): axis across which to select the values

        Returns:
            Tensor: Tensor with selected values
Select a subset of elements from an array across an axis.
Select a subset of elements from an array across an axis .
def take(self, indices, axis=None):
        """
        Select a subset of elements from an array across an axis.

        Arguments:
            indices (Tensor, numpy ndarray): indicies of elements to select
            axis (int): axis across which to select the values

        Returns:
            Tensor: Tensor with selected values

        """
        if type(indices) == self.__class__:
            indices = indices._tensor
        # if indices are nx1 or 1xn, much of our code assumes these dims are
        # collapsed, hence the squeeze call.
        if type(indices) == np.ndarray:
            indices = indices.squeeze()
        new_shape = list(self.shape)
        new_shape[axis] = indices.size
        return self.__class__(
            backend=self.backend,
            ary=self._tensor.take(indices, axis).reshape(new_shape),
            dtype=self._tensor.dtype,
            base=self)
def take ( self , indices , axis = None ) : if type ( indices ) == self . __class__ : indices = indices . _tensor # if indices are nx1 or 1xn, much of our code assumes these dims are # collapsed, hence the squeeze call. if type ( indices ) == np . ndarray : indices = indices . squeeze ( ) new_shape = list ( self . shape ) new_shape [ axis ] = indices . size return self . __class__ ( backend = self . backend , ary = self . _tensor . take ( indices , axis ) . reshape ( new_shape ) , dtype = self . _tensor . dtype , base = self )