pylops_gpu.Laplacian

pylops_gpu.Laplacian(dims, dirs=(0, 1), weights=(1, 1), sampling=(1, 1), device='cpu', togpu=(False, False), tocpu=(False, False), dtype=torch.float32)[source]

Laplacian.

Apply second-order centered laplacian operator to a multi-dimensional array (at least 2 dimensions are required)

Parameters:
dims : tuple

Number of samples for each dimension.

dirs : tuple, optional

Directions along which laplacian is applied.

weights : tuple, optional

Weight to apply to each direction (real laplacian operator if weights=[1,1])

sampling : tuple, optional

Sampling steps dx and dy for each direction

edge : bool, optional

Use reduced order derivative at edges (True) or ignore them (False)

device : str, optional

Device to be used

togpu : tuple, optional

Move model and data from cpu to gpu prior to applying matvec and rmatvec, respectively (only when device='gpu')

tocpu : tuple, optional

Move data and model from gpu to cpu after applying matvec and rmatvec, respectively (only when device='gpu')

dtype : str, optional

Type of elements in input array.

Returns:
l2op : pylops.LinearOperator

Laplacian linear operator

Notes

Refer to pylops.basicoperators.Laplacian for implementation details.

Note that since the Torch implementation is based on a convolution with a compact filter \([1., -2., 1.]\), edges are treated differently compared to the PyLops equivalent operator.

Examples using pylops_gpu.Laplacian