nn.Correlation

class horizon_plugin_pytorch.nn.Correlation (kernel_size: int = 1, max_displacement: int = 1, stride1: int = 1, stride2: int = 1, pad_size: int = 0, is_multiply: bool = True)

Parameters:

kernel_size (int) – kernel size for Correlation must be an odd number

max_displacement (int) – Max displacement of Correlation

stride1 (int) – stride1 quantize data1 globally

stride2 (int) – stride2 quantize data2 within neighborhood centered around data1

pad_size (int) – pad for Correlation

is_multiply (bool) – operation type is either multiplication or subduction, only support True now

forward (data1: Tensor | QTensor, data2: Tensor | QTensor)

Forward for Horizon Correlation.

Parameters:

data1 (Union[Tensor, QTensor]) – shape of [N,C,H,W]

data2 (Union[Tensor, QTensor]) – shape of [N,C,H,W]

Returns: output

Return type: Tensor