Skip to content

A minor bug when encountering an empty graph #36

@bhcao

Description

@bhcao

https://github.com/instadeepai/mlip/blob/main/src/mlip/data/helpers/neighborhood.py#L107

It should be np.zeros((len(senders), 3)) instead of np.array([[0] * 3] * len(senders)). Although they are mostly equal, errors may occur in certain situations as follows.

When len(senders) == 0, which means the graph is empty, the shape of shifts will be (0,) instead of (0,3), which will cause shape mismatching when concat the empty graph with others (this will be called by jraph.batch_np in dynamically_batch). This situation does not occur during training because the empty graphs have been filtered, but it may still occur when using run_batched_inference.

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