Skip to content

Exposing scope name to python while tracing #4195

@hhsecond

Description

@hhsecond

It would be really great to have scope name available on nodes in the traced graph. Reposting what @lantiga has suggested.

Something like node.scope() could return a string Foo/Bar or Foo/Bar[baz], where Foo and Bar are scope names. The second form will be generated automatically by modules, one scope name per module: in this case baz is the name of the variable containing the module Bar in the parent module Foo

class Foo(nn.Module):
    def __init__(self):
        [...]
        self.baz = Bar()

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