diff --git a/pygrad/tensor.py b/pygrad/tensor.py index 00d94ec..c01f1f0 100644 --- a/pygrad/tensor.py +++ b/pygrad/tensor.py @@ -7,6 +7,8 @@ class Tensor: # TODO Implement 'requires_grad' functionality. def __init__(self, value): # TODO Add support for scalar values. + if isinstance(value, list): + value = np.array(value) if not isinstance(value, np.ndarray): print(f"{type(value)} is not compatible with {np.ndarray}") exit(-1)