Skip to content

Update Intro YouTube Building Models tutorial — Softmax dim, super() style #3856

@svekars

Description

@svekars

Description

The Building Models with PyTorch tutorial has a deprecated nn.Softmax() call and uses outdated Python 2-style super() syntax.

Changes needed

Deprecated APIs

  • nn.Softmax()nn.Softmax(dim=1): Calling Softmax() without dim raises a UserWarning: "Implicit dimension choice for softmax has been deprecated." Specify the appropriate dimension explicitly.

Outdated patterns

  • Python 2-style super()super().__init__(): Update 3 classes:
    • super(TinyModel, self).__init__()super().__init__()
    • super(LeNet, self).__init__()super().__init__()
    • super(LSTMTagger, self).__init__()super().__init__()

Files

cc @subramen

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions