def test_maxpool(workers): alice, bob, james = workers["alice"], workers["bob"], workers["james"] x = th.tensor([[10, 0], [15, 7]]).share(alice, bob, crypto_provider=james).child max, ind = maxpool(x) assert max.get() == torch.tensor(15) assert ind.get() == torch.tensor(2)
def test_maxpool(workers): alice, bob, james = workers["alice"], workers["bob"], workers["james"] x = ( torch.tensor([[10, 0], [15, 7]]) .share(alice, bob, crypto_provider=james, dtype="long") .child ) max, ind = maxpool(x) assert max.get() == torch.tensor(15) assert ind.get() == torch.tensor(2) # With dtype int x = torch.tensor([[10, 0], [15, 7]]).share(alice, bob, crypto_provider=james, dtype="int").child max, ind = maxpool(x) assert max.get() == torch.tensor(15) assert ind.get() == torch.tensor(2)
def test_maxpool(workers): alice, bob, james = ( workers["alice"], workers["bob"], workers["james"], ) tensorA = (torch.tensor([[0, 1, 8, 3, 4]]).share(alice, bob, crypto_provider=james, dtype="long").child) v, i = securenn.maxpool(tensorA) assert (v.get() == torch.tensor([[8]])).all() assert (i.get() == torch.tensor([[2]])).all()