Skip to content

Commit

Permalink
Lazy load torch in utils.basic
Browse files Browse the repository at this point in the history
  • Loading branch information
rjavadi authored and Scienfitz committed Mar 7, 2024
1 parent c290908 commit 3401a4e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion baybe/utils/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from typing import Callable, Dict, Iterable, List, TypeVar

import numpy as np
import torch

_C = TypeVar("_C", bound=type)
_T = TypeVar("_T")
Expand Down Expand Up @@ -57,6 +56,8 @@ def set_random_seed(seed: int):
Args:
seed: The chosen global random seed.
"""
import torch

torch.manual_seed(seed)
random.seed(seed)
np.random.seed(seed)
Expand Down

0 comments on commit 3401a4e

Please sign in to comment.