Skip to content
This repository was archived by the owner on Jun 28, 2022. It is now read-only.
This repository was archived by the owner on Jun 28, 2022. It is now read-only.

Parts 2-6: Fix for PyTorch 1.1 #10

@Onestroke1

Description

@Onestroke1

Current code in Parts 2-6 causes an error in PyTorch 1.1.

transform = transforms.Compose([transforms.ToTensor(),
transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5)),
])
RuntimeError: output with shape [1, 28, 28] doesn't match the broadcast shape [3, 28, 28]

I made the following change and it worked for PyTorch 0.4 and 1.1:

transform = transforms.Compose([transforms.ToTensor(),
transforms.Normalize([0.5], [0.5])])

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