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
anddy
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
andrmatvec
, respectively (only whendevice='gpu'
)- tocpu :
tuple
, optional Move data and model from gpu to cpu after applying
matvec
andrmatvec
, respectively (only whendevice='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.
- dims :