Open1

Reduce Mean -> TPU (More than one subgraph is not supported)

PINTOPINTO
import numpy as np
from pprint import pprint

a = np.asarray([[[[1,2,3,4,5],[6,7,8,9,10]],[[1,2,3,4,5],[6,7,8,9,10]]]])

### pattern.1
x = np.average(a, axis=(1,2))
x.shape
# (1, 5)
pprint(x)
# array([[3.5, 4.5, 5.5, 6.5, 7.5]])

### pattern.2
x = np.average(a, axis=1)
x.shape
# (1, 2, 5)
pprint(x)
# array([[3.5, 4.5, 5.5, 6.5, 7.5]])
y = np.average(x, axis=1)
y.shape
# (1, 5)
pprint(y)
# array([[3.5, 4.5, 5.5, 6.5, 7.5]])