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
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