Skip to content

Cosmetic warning on import: TorchScript instance-level annotations #1485

Description

@chengjilai

Importing mace.modules triggers a cosmetic warning:

UserWarning: The TorchScript type system doesn't support instance-level annotations on empty non-base types in `__init__`.

Root cause

Instance-level type annotations in GatedEquivariantBlock.__init__ (mace/modules/gate.py) are flagged by TorchScript. This is a known PyTorch issue (pytorch#89064, open since June 2024).

Fix

PR #1484 adds a warnings.filterwarnings in mace/modules/__init__.py to suppress the message. No functional impact — e3nn already does the same in its compile() path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions