Skip to content

3.2.1 RuntimeError: expected scalar type Double but found Float #24

@lileidev

Description

@lileidev

It reports "expected scalar type Double but found Float" with torch.mm in chapter 3.2.1.
Fixed by add "to (torch.float32)" as bellow:
features = torch.from_numpy(np.random.normal(0, 1, (num_examples, num_inputs))).to(torch.float32)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions