Commit 7ce78c0
authored
Fix nxp unittests (#15384)
Let's not hard code the number of nodes in the graph.
The graph of batch norm + conv looks like this after torch nightly 1015:
```
graph():
%p_conv_weight : [num_users=1] = placeholder[target=p_conv_weight]
%p_conv_bias : [num_users=1] = placeholder[target=p_conv_bias]
%p_batch_norm_batch_norm_weight : [num_users=1] = placeholder[target=p_batch_norm_batch_norm_weight]
%p_batch_norm_batch_norm_bias : [num_users=1] = placeholder[target=p_batch_norm_batch_norm_bias]
%b_batch_norm_batch_norm_running_mean : [num_users=1] = placeholder[target=b_batch_norm_batch_norm_running_mean]
%b_batch_norm_batch_norm_running_var : [num_users=1] = placeholder[target=b_batch_norm_batch_norm_running_var]
%x : [num_users=1] = placeholder[target=x]
%conv2d : [num_users=1] = call_function[target=torch.ops.aten.conv2d.default](args = (%x, %p_conv_weight, %p_conv_bias), kwargs = {})
%batch_norm : [num_users=1] = call_function[target=torch.ops.aten.batch_norm.default](args = (%conv2d, %p_batch_norm_batch_norm_weight, %p_batch_norm_batch_norm_bias, %b_batch_norm_batch_norm_running_mean, %b_batch_norm_batch_norm_running_var, False, 0.1, 1e-05, True), kwargs = {})
return (batch_norm,)
```1 parent 51b83ff commit 7ce78c0
1 file changed
+10
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
109 | | - | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
110 | 112 | | |
111 | | - | |
112 | 113 | | |
113 | 114 | | |
114 | 115 | | |
| |||
118 | 119 | | |
119 | 120 | | |
120 | 121 | | |
121 | | - | |
| 122 | + | |
122 | 123 | | |
123 | 124 | | |
124 | 125 | | |
| |||
139 | 140 | | |
140 | 141 | | |
141 | 142 | | |
142 | | - | |
143 | | - | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
144 | 147 | | |
145 | | - | |
146 | 148 | | |
147 | 149 | | |
148 | 150 | | |
| |||
152 | 154 | | |
153 | 155 | | |
154 | 156 | | |
155 | | - | |
| 157 | + | |
156 | 158 | | |
157 | 159 | | |
158 | 160 | | |
| |||
0 commit comments