Skip to content

view() method not previously introduced #5

@10538

Description

@10538

In section 7.1.4, the authors write:

In[16]:

mean = imgs.view(3, -1).mean(dim=1)
mean

Out[16]:

tensor([0.4914, 0.4822, 0.4465])
Recall that view(3, -1) keeps the three channels and merges all the remaining dimen-
sions into one, figuring out the appropriate size. Here, our 3 × 32 × 32 image is trans-
formed into a 3 × 1,024 vector, and then the mean is taken over the 1,024 elements of
each channel.

However, this is the first time that the view() method has been used in the book. "Recall" is not applicable.

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