Skip to content

[Code scan] Fix none embedding constructor and node output property #355

Description

@njzjz

This issue is part of a Codex global repository scan.

Problem:
The Embedding(method="none") implementation calls torch.nn.Module.__init__ with extra arguments. It also exposes out_note_dim instead of out_node_dim, while NNENV reads self.embedding.out_node_dim when building SKTB prediction layers.

Code references:
https://github.com/deepmodeling/deeptb/blob/86c60c73996f0dd961c3138f2e88424382cb734e/dptb/nn/embedding/identity.py#L8-L24
https://github.com/deepmodeling/deeptb/blob/86c60c73996f0dd961c3138f2e88424382cb734e/dptb/nn/deeptb.py#L131-L143

Impact:
The none embedding path fails during model construction, and would still fail later with AttributeError even after the constructor is fixed.

Suggested fix:
Call super().__init__() without extra arguments and rename/add the property as out_node_dim.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions