Line 45 in math_interface.py creates list of tensors as follows:
x_var = [minitorch.tensor(x, requires_grad=True) for x in xs]
This leads to an error when x is not a list or tuple.
This error can be corrected in tensor_functions.py by adding the following code in def tensor(): before processing ls
if not isinstance(ls, (list, tuple)):
ls = [ls]
Line 45 in
math_interface.pycreates list of tensors as follows:This leads to an error when
xis not alistortuple.This error can be corrected in
tensor_functions.pyby adding the following code indef tensor():before processingls