Пример #1
0
 def f(x):
   return reduce_sum(nonzero(x), tuple(range(len(x.shape))))
Пример #2
0
 def f(x):
   nonzero_idx = nonzero(x)
   return reduce_sum(nonzero_idx)
Пример #3
0
 def f(x):
   y = sin(x)
   return reduce_sum(y, axes=(0,))