Skip to content

Commit 04fd4a5

Browse files
committed
possibily best version
1 parent fefe3d1 commit 04fd4a5

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

madgraph_plugin/template_files/matrix_method_python.inc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,10 @@ class Matrix_%(process_string)s(object):
101101
def loopable_matrix(hel):
102102
return self.matrix(all_ps, hel, %(params)s)
103103

104-
ans = tf.map_fn(loopable_matrix, self.helicities, back_prop=False, fn_output_signature=DTYPE)
105-
return tf.reduce_sum(ans, axis=0)/self.denominator
104+
ans = tf.zeros_like(all_ps[:,0,0])
105+
for hel in self.helicities:
106+
ans += loopable_matrix(hel)
107+
return ans/self.denominator
106108

107109

108110
@tf.function(input_signature=matrix_signature)

0 commit comments

Comments
 (0)