awslabs / gluonts

Probabilistic time series modeling in Python
https://ts.gluon.ai
Apache License 2.0
4.64k stars 755 forks source link

Import error in pts module: gluonts/nursery/robust-mts-attack/pts/modules/distribution_output.py #3193

Open ClaraGrthns opened 5 months ago

ClaraGrthns commented 5 months ago

Description

There is an Import error in the pts module in gluonts/nursery/robust-mts-attack/pts/modules/distribution_output.py

To Reproduce

The following lines of code yield the Import Error:

from gluonts.torch.modules.distribution_output import (
    DistributionOutput,
    LambdaLayer,
    PtArgProj,
)

Error message or code output

Traceback (most recent call last):
  File "gluonts/src/gluonts/nursery/robust-mts-attack/pts/modules/distribution_output.py", line 47, in <module>
    from gluonts.torch.modules.distribution_output import (
ModuleNotFoundError: No module named 'gluonts.torch.modules.distribution_output'

Proposed Solution:

The following lines of code should solve the problem to match the current version of gluonts (v 0.15.0).

from gluonts.torch.distributions.distribution_output import DistributionOutput
from gluonts.torch.modules.lambda_layer import LambdaLayer
from gluonts.torch.distributions.output import PtArgProj

Environment