nngeometry/object/pspace.py
def size(self, dim=None):
        """
        Size of the matrix as a tuple, regardless of the actual size in memory.

        :param dim: dimension
        :type dim: int or None

        >>> M.size()
        (1254, 1254)
        >>> M.size(0)
        1254
        """
        # TODO: test
        s = self.generator.layer_collection.numel()
        if dim == 0 or dim == 1:
            return s
        elif dim is None:
            return (s, s)
        else:
            raise IndexError

        Size of the matrix as a tuple, regardless of the actual size in memory.

        :param dim: dimension
        :type dim: int or None

        >>> M.size()
        (1254, 1254)
        >>> M.size(0)
        1254
        
Size of the matrix as a tuple, regardless of the actual size in memory.
Size of the matrix as a tuple regardless of the actual size in memory .
def size(self, dim=None):
        s = self.generator.layer_collection.numel()
        if dim == 0 or dim == 1:
            return s
        elif dim is None:
            return (s, s)
        else:
            raise IndexError
def size ( self , dim = None ) : s = self . generator . layer_collection . numel ( ) if dim == 0 or dim == 1 : return s elif dim is None : return ( s , s ) else : raise IndexError
Size of the matrix as a tuple, regardless of the actual size in memory.
Size of the matrix as a tuple regardless of the actual size in memory .
"""
        Size of the matrix as a tuple, regardless of the actual size in memory.

        :param dim: dimension
        :type dim: int or None

        >>> M.size()
        (1254, 1254)
        >>> M.size(0)
        1254
        """ # TODO: test
self
dim
None