Skip to content

Commit

Permalink
test RF utils, allow without TF
Browse files Browse the repository at this point in the history
  • Loading branch information
albertz committed Nov 9, 2023
1 parent 0f48d49 commit 17915f8
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions tests/rf_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,27 @@
import re
import numpy
import numpy.testing
import tensorflow as tf

try:
import tensorflow as tf
except ImportError:
tf = globals().get("tf", None) # type: ignore

from returnn.config import Config, global_config_ctx
from returnn.util.pprint import pprint
import returnn.frontend as rf
from returnn.tensor import Tensor, Dim, TensorDict
from returnn.tensor.utils import tensor_dict_fill_random_numpy_
import returnn.tf.compat as tf_compat
import returnn.torch.frontend as rft
import returnn.tf.frontend_layers as rfl
from returnn.tf.network import TFNetwork
from returnn.torch.data.tensor_utils import tensor_dict_numpy_to_torch_, tensor_dict_torch_to_numpy_

if tf:
import returnn.tf.compat as tf_compat
import returnn.tf.frontend_layers as rfl
from returnn.tf.network import TFNetwork
else:
tf_compat = rfl = TFNetwork = None

# noinspection PyProtectedMember
from returnn.frontend._random_journal import RandomJournal

Expand Down

0 comments on commit 17915f8

Please sign in to comment.