Skip to content

tensor creation error in math_interface.py #19

@suryabulusu

Description

@suryabulusu

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]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions