Skip to content

Commit

Permalink
fix pd
Browse files Browse the repository at this point in the history
  • Loading branch information
njzjz authored Dec 19, 2024
1 parent cf6e6e2 commit 63dc3d3
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion deepmd/pd/utils/dataloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,16 @@
default_collate_fn,
)

from deepmd.utils import dp_random
from deepmd.pd.utils import (
env,
)
from deepmd.pd.utils.dataset import (
DeepmdDataSetForLoader,
)
from deepmd.pt.utils.utils import (
mix_entropy,
)
from deepmd.utils.data import (
DataRequirementItem,
)
Expand All @@ -50,8 +54,13 @@


def setup_seed(seed):
paddle.seed(seed)
if isinstance(seed, (list, tuple)):
mixed_seed = mix_entropy(seed)
else:
mixed_seed = seed
paddle.seed(mixed_seed)
os.environ["FLAGS_cudnn_deterministic"] = "True"
dp_random.seed(seed)


class DpLoaderSet(Dataset):
Expand Down

0 comments on commit 63dc3d3

Please sign in to comment.