@@ -88,15 +88,15 @@ def test_runtime_broadcast(mode):
88
88
check_blockwise_runtime_broadcasting (mode )
89
89
90
90
91
- class TestOp (Op ):
91
+ class MyTestOp (Op ):
92
92
def make_node (self , * inputs ):
93
93
return Apply (self , inputs , [i .type () for i in inputs ])
94
94
95
95
def perform (self , * args , ** kwargs ):
96
96
raise NotImplementedError ("Test Op should not be present in final graph" )
97
97
98
98
99
- test_op = TestOp ()
99
+ test_op = MyTestOp ()
100
100
101
101
102
102
def test_vectorize_node_default_signature ():
@@ -106,12 +106,12 @@ def test_vectorize_node_default_signature():
106
106
107
107
vect_node = vectorize_node (node , mat , mat )
108
108
assert isinstance (vect_node .op , Blockwise ) and isinstance (
109
- vect_node .op .core_op , TestOp
109
+ vect_node .op .core_op , MyTestOp
110
110
)
111
111
assert vect_node .op .signature == ("(i00),(i10,i11)->(o00),(o10,o11)" )
112
112
113
113
with pytest .raises (
114
- ValueError , match = "Signature not provided nor found in core_op TestOp "
114
+ ValueError , match = "Signature not provided nor found in core_op MyTestOp "
115
115
):
116
116
Blockwise (test_op )
117
117
@@ -138,7 +138,7 @@ def test_blockwise_shape():
138
138
139
139
shape_fn = pytensor .function ([inp ], out .shape )
140
140
assert not any (
141
- isinstance (getattr (n .op , "core_op" , n .op ), TestOp )
141
+ isinstance (getattr (n .op , "core_op" , n .op ), MyTestOp )
142
142
for n in shape_fn .maker .fgraph .apply_nodes
143
143
)
144
144
assert tuple (shape_fn (inp_test )) == (5 , 3 , 4 )
@@ -150,13 +150,13 @@ def test_blockwise_shape():
150
150
151
151
shape_fn = pytensor .function ([inp ], out .shape )
152
152
assert any (
153
- isinstance (getattr (n .op , "core_op" , n .op ), TestOp )
153
+ isinstance (getattr (n .op , "core_op" , n .op ), MyTestOp )
154
154
for n in shape_fn .maker .fgraph .apply_nodes
155
155
)
156
156
157
157
shape_fn = pytensor .function ([inp ], out .shape [:- 1 ])
158
158
assert not any (
159
- isinstance (getattr (n .op , "core_op" , n .op ), TestOp )
159
+ isinstance (getattr (n .op , "core_op" , n .op ), MyTestOp )
160
160
for n in shape_fn .maker .fgraph .apply_nodes
161
161
)
162
162
assert tuple (shape_fn (inp_test )) == (5 , 4 )
@@ -174,20 +174,20 @@ def test_blockwise_shape():
174
174
175
175
shape_fn = pytensor .function ([inp1 , inp2 ], [out .shape for out in outs ])
176
176
assert any (
177
- isinstance (getattr (n .op , "core_op" , n .op ), TestOp )
177
+ isinstance (getattr (n .op , "core_op" , n .op ), MyTestOp )
178
178
for n in shape_fn .maker .fgraph .apply_nodes
179
179
)
180
180
181
181
shape_fn = pytensor .function ([inp1 , inp2 ], outs [0 ].shape )
182
182
assert not any (
183
- isinstance (getattr (n .op , "core_op" , n .op ), TestOp )
183
+ isinstance (getattr (n .op , "core_op" , n .op ), MyTestOp )
184
184
for n in shape_fn .maker .fgraph .apply_nodes
185
185
)
186
186
assert tuple (shape_fn (inp1_test , inp2_test )) == (7 , 5 , 3 , 4 )
187
187
188
188
shape_fn = pytensor .function ([inp1 , inp2 ], [outs [0 ].shape , outs [1 ].shape [:- 1 ]])
189
189
assert not any (
190
- isinstance (getattr (n .op , "core_op" , n .op ), TestOp )
190
+ isinstance (getattr (n .op , "core_op" , n .op ), MyTestOp )
191
191
for n in shape_fn .maker .fgraph .apply_nodes
192
192
)
193
193
assert tuple (shape_fn (inp1_test , inp2_test )[0 ]) == (7 , 5 , 3 , 4 )
0 commit comments