Skip to content

question about ”d2l = sys.modules[__name__]“ #2589

@lprdsb

Description

@lprdsb

I want to know why in d2l.torch there is this line of code: d2l = sys.modules[name], which causes my IDE to not correctly recognize some functions inside torch. When I try to view the source code, it doesn't jump to the correct location. However, I believe there might be another purpose for writing it this way, and I want to understand the benefits of doing so.

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