Skip to content

An Issue with solve_1d_linesearch_quad Function #442

@Nuwaisir-1998

Description

@Nuwaisir-1998

I had this error: TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.

After some observation, I found that inside solve_1d_linesearch_quad function in optim.py, np.divide is used. I think it should be nx.divide where nx = get_backend(a, b, c). And inside TorchBackend class, a new method for divide should be added that uses torch.div function.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions