9
9
10
10
import cmsml
11
11
from cmsml .util import tmp_dir , tmp_file
12
- import cmsml .tensorflow .tools as cmsml_tools
13
- from cmsml .tensorflow .aot import get_graph_ops , OpsData
12
+ # from cmsml.tensorflow.aot import get_graph_ops, OpsData
14
13
15
14
from . import CMSMLTestCase
16
15
@@ -57,6 +56,8 @@ def tf_version(self):
57
56
return self ._tf_version
58
57
59
58
def create_graph_def (self , create = "saved_model" , ** kwargs ):
59
+ import cmsml .tensorflow .tools as cmsml_tools
60
+
60
61
# helper function to create GraphDef from SavedModel or Graph
61
62
tf = self .tf
62
63
@@ -91,6 +92,8 @@ def create_graph_def(self, create="saved_model", **kwargs):
91
92
92
93
@skip_if_no_tf2xla_supported_ops
93
94
def test_get_graph_ops_saved_model (self ):
95
+ from cmsml .tensorflow .aot import get_graph_ops
96
+
94
97
tf_graph_def , keras_graph_def = self .create_graph_def (create = "saved_model" )
95
98
96
99
graph_ops = set (get_graph_ops (tf_graph_def , node_def_number = 0 ))
@@ -105,6 +108,8 @@ def test_get_graph_ops_saved_model(self):
105
108
106
109
@skip_if_no_tf2xla_supported_ops
107
110
def test_get_graph_ops_graph (self ):
111
+ from cmsml .tensorflow .aot import get_graph_ops
112
+
108
113
concrete_function_graph_def = self .create_graph_def (create = "graph" )
109
114
graph_ops = set (get_graph_ops (concrete_function_graph_def , node_def_number = 0 ))
110
115
@@ -147,6 +152,8 @@ def tf_version(self):
147
152
148
153
@skip_if_no_tf2xla_supported_ops
149
154
def test_parse_ops_table (self ):
155
+ from cmsml .tensorflow .aot import OpsData
156
+
150
157
ops_dict = OpsData .parse_ops_table (device = "cpu" )
151
158
expected_ops = ("Abs" , "Acosh" , "Add" , "Atan" , "BatchMatMul" , "Conv2D" )
152
159
@@ -158,6 +165,8 @@ def test_parse_ops_table(self):
158
165
159
166
@skip_if_no_tf2xla_supported_ops
160
167
def test_determine_ops (self ):
168
+ from cmsml .tensorflow .aot import OpsData
169
+
161
170
# function to merge multiple tables
162
171
devices = ("cpu" , "gpu" )
163
172
0 commit comments