'Returns the size of the leading dimension of self.
Returns:
int: The size of the leading dimension.'

def __len__(self):

    if len(self.shape):
        return self.shape[0]
    else:
        return 0
