Example #1
0
def get_test_warp(indices, **kwargs):
    warp_tf = Warp(indices=indices, **kwargs)
    c0 = torch.tensor([1.0, 2.0])[:len(indices)]
    c1 = torch.tensor([2.0, 3.0])[:len(indices)]
    batch_shape = kwargs.get("batch_shape", torch.Size([]))
    c0 = c0.expand(batch_shape + c0.shape)
    c1 = c1.expand(batch_shape + c1.shape)
    warp_tf._set_concentration(0, c0)
    warp_tf._set_concentration(1, c1)
    return warp_tf
Example #2
0
def get_test_warp(indices, **kwargs):
    warp_tf = Warp(indices=indices, **kwargs)
    warp_tf._set_concentration(0, torch.tensor([1.0, 2.0]))
    warp_tf._set_concentration(1, torch.tensor([2.0, 3.0]))
    return warp_tf