以下のコードを実行すると

ValueError: Failed to broadcast arrays

とエラーが表示されました、デバッグするとlossを計算するときに何か問題があるようですがそれ以上がわかりません。どうすれば良いでしょうか?

追記:
1. https://colab.research.google.com/github/chainer-community/chainer-colab-notebook/blob/master/hands_on_ja/chainer/chainer_tutorial_book.ipynb#scrollTo=A5-zC32qbpQM
2. http://ailaby.com/chainer_foward_backward/
3. https://qiita.com/yoshizaki_kkgk/items/bfe559d1bdd434be03ed
4. https://docs.chainer.org/en/v1.9.1/tutorial/basic.html

class MLP(chainer.Chain):
    def __init__(self, n_units, n_outs):
        super(MLP, self).__init__()
        with self.init_scope():
            self.l1 = L.Linear(None, n_units)
            self.l2 = L.Linear(None, n_units)
            self.l3 = L.Linear(None, n_outs)

    def __call__(self, x, *args, **kwargs):
        h1 = F.relu(self.l1(x))
        h2 = F.relu(self.l2(h1))
        y = self.l3(h2)
        return y


x = np.array([[1.,5.,0.,1.,3.],
              [2.,3.,1.,3.,9.],
              [0.,4.,4.,2.,1.],
              [2.,3.,0.,4.,7.],
              [0.,9.,0.,6.,4.],
              [3.,4.,3.,1.,0.],
              [1.,4.,0.,3.,1.],
              [8.,1.,3.,3.,1.]], dtype=np.float32)

y = np.array([0.2, 0.3, 0.4, 0.3, 0.9, 0.4, 0.7, 0.0], dtype=np.float32)


model = MLP(5, 1)
h = model(x)

opt = optimizers.Adam()
opt.setup(model)


for i in range(0,1000):
    loss = F.bernoulli_nll(y, h)
    print(loss.data)
    opt.update(loss, x, y, model)