Commit 61a550d1 authored by Philipp Arras's avatar Philipp Arras
Browse files

Fixup ValueInserter

parent c6e6487d
Pipeline #63203 passed with stages
in 5 minutes and 35 seconds
...@@ -34,8 +34,8 @@ def test_value_inserter(sp, seed): ...@@ -34,8 +34,8 @@ def test_value_inserter(sp, seed):
np.random.seed(seed) np.random.seed(seed)
ind = tuple([np.random.randint(0, ss - 1) for ss in sp.shape]) ind = tuple([np.random.randint(0, ss - 1) for ss in sp.shape])
op = ift.ValueInserter(sp, ind) op = ift.ValueInserter(sp, ind)
f = ift.from_random('normal', ift.UnstructuredDomain((1,))) f = ift.from_random('normal', op.domain)
inp = f.to_global_data()[0] inp = f.to_global_data()
ret = op(f).to_global_data() ret = op(f).to_global_data()
assert_(ret[ind] == inp) assert_(ret[ind] == inp)
assert_(np.sum(ret) == inp) assert_(np.sum(ret) == inp)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment