a33253b2e850ded23f4661555d65bd01082ecb55,chainer/functions/math/average.py,Sum,forward,#Sum#Any#,52
Before Change
def forward(self, inputs):
x, = inputs
ret = x.sum(axis=self.axis, keepdims=self.keepdims)
if backend.get_array_module(x) is numpy:
ret = numpy.asarray(ret)
return ret,
After Change
def forward(self, inputs):
x, = inputs
if self.axis is None:
self.multiplier = 1.0 / x.size
else:
divider = 1
for axis in self.axis:
divider *= x.shape[axis]
self.multiplier = 1.0 / divider
ret = utils.force_array(
x.mean(axis=self.axis, keepdims=self.keepdims))
return ret,
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances Project Name: chainer/chainer
Commit Name: a33253b2e850ded23f4661555d65bd01082ecb55
Time: 2019-07-11
Author: kataoka@preferred.jp
File Name: chainer/functions/math/average.py
Class Name: Sum
Method Name: forward
Project Name: pfnet-research/chainer-chemistry
Commit Name: c977c0b4542a50a71fa2913bda2a99ddc128a1e9
Time: 2018-06-20
Author: mottodora@gmail.com
File Name: chainer_chemistry/functions/mean_absolute_error.py
Class Name: MeanAbsoluteError
Method Name: backward
Project Name: explosion/thinc
Commit Name: cc8d7ba5562cb2335d975b67e88a81a6bc9b0f46
Time: 2020-01-12
Author: honnibal+gh@gmail.com
File Name: thinc/loss.py
Class Name:
Method Name: categorical_crossentropy