MCPcopy Index your code
hub / github.com/tensorpack/tensorpack / is_tfv2

Function is_tfv2

tensorpack/compat/__init__.py:21–29  ·  view source on GitHub ↗

Returns whether tensorflow is operating in V2 mode.

()

Source from the content-addressed store, hash-verified

19
20
21def is_tfv2():
22 """
23 Returns whether tensorflow is operating in V2 mode.
24 """
25 try:
26 from tensorflow.python import tf2
27 return tf2.enabled()
28 except Exception:
29 return False
30
31
32if is_tfv2():

Callers 4

__init__.pyFile · 0.85
launch_train_with_configFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected