예제 #1
0
def einsum(notation, *args, tensor=False):
    if use_numpy_einsum:
        args = Numpy(*args)
        out = np_einsum(notation, *args)
    else:
        args = Tensor(*args)
        try:
            out = t_einsum(notation, *args)
        except:
            out = t_einsum(notation, args)
    if tensor:
        return toTensor(out)
    return out
예제 #2
0
def einsum(notation, *args, tensor=False):
    if USE_NUMPY_EINSUM:
        args = Numpy(*args)
        out = np_einsum(notation, *args)
    else:
        args = Tensors(*args)
        try:
            out = t_einsum(notation, *args)
        except:
            out = t_einsum(notation, args)
    if tensor:
        return Tensor(out)
    return out