utils.py
def itemize(x):
    """Converts a Tensor into a list of Python numbers.
    """
    if len(x.shape) < 1:
        x = x[None]
    if x.shape[0] > 1:
        return [xx.item() for xx in x]
    else:
        return x.item()
Converts a Tensor into a list of Python numbers.
    
Converts a Tensor into a list of Python numbers.
Converts a Tensor into a list of Python numbers .
def itemize(x):
    if len(x.shape) < 1:
        x = x[None]
    if x.shape[0] > 1:
        return [xx.item() for xx in x]
    else:
        return x.item()
def itemize ( x ) : if len ( x . shape ) < 1 : x = x [ None ] if x . shape [ 0 ] > 1 : return [ xx . item ( ) for xx in x ] else : return x . item ( )
Converts a Tensor into a list of Python numbers.
Converts a Tensor into a list of Python numbers .
"""Converts a Tensor into a list of Python numbers.
    """
x