Skip to content

Mistake in 1.2-automatic-differentiation.ipynb #1

@cgoecknerwald

Description

@cgoecknerwald

Text in notebook:

z.sum().backward()
print(x.grad)
tensor([[27., 27.],
[27., 27.]])

It says "You should have got a matrix of 4.5." This code actually creates

tensor([[27., 27.],
[27., 27.]])

It looks like it should instead be:

z.sum()
print(x.grad)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions