def normalise_tensor(tensor):
    '''
    Normalise the tensor by dividing it by its norm, defined such that
    np.sqrt(X:X)
    '''
    tensor_norm = np.linalg.norm(tensor)
    return tensor / tensor_norm, tensor_norm
def normalise_tensor ( tensor ) : tensor_norm = np . linalg . norm ( tensor ) return tensor / tensor_norm , tensor_norm
Normalise the tensor by dividing it by its norm, defined such that
    np.sqrt(X:X)