0940b083d3cdd0db46c867523e9a58b196e6e9d5,python/test/function/test_assign.py,,test_assign_forward_backward,#Any#Any#Any#,30
Before Change
def test_assign_forward_backward(seed, ctx, func_name):
from nbla_test_utils import function_tester
rng = np.random.RandomState(seed)
inputs = [rng.randn(2, 3, 4).astype(np.float32) * 2 for _ in range(2)]
grads = np.zeros((48,))
function_tester(rng, F.assign, lambda dst, src: src, inputs, ref_grad=lambda *args: grads,
ctx=ctx, func_name=func_name, atol_f=1e-3, atol_b=1e-2)
After Change
dst.grad.zero()
src.grad.zero()
dummy.forward()
dummy.backward()
// assign should not propagate gradients
assert np.all(dst.g == np.zeros((2, 3, 4)))
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances
Project Name: sony/nnabla
Commit Name: 0940b083d3cdd0db46c867523e9a58b196e6e9d5
Time: 2019-01-09
Author: takuma.seno@gmail.com
File Name: python/test/function/test_assign.py
Class Name:
Method Name: test_assign_forward_backward
Project Name: BindsNET/bindsnet
Commit Name: b6240c06fb49020e2d51703a1fcfddba7e27297d
Time: 2019-06-21
Author: djsaunde@umass.edu
File Name: bindsnet/network/network.py
Class Name: Network
Method Name: run
Project Name: GPflow/GPflow
Commit Name: 5e479101e6f577e2841f89731ccae4402a57cf4d
Time: 2017-08-15
Author: mv310@cam.ac.uk
File Name: GPflow/param.py
Class Name: Param
Method Name: get_samples_df