CDist (CPU)#

  • Domain: com.microsoft

  • Device: CPU

  • Kernel: onnx_light_cpu::CDist

  • Supported types: FLOAT, DOUBLE

  • Opset bounds: since opset 1

Operator support#

Capability

Implementation

Shape inference

onnx_light_cpu::ComputeShapeCDist()

Peak memory

onnx_light_cpu::ComputePeakMemoryCDist()

Fusion patterns

onnx_light_cpu::CDistFusionPattern

Gradient

onnx_light_cpu::RegisterCustomOperatorGradients()

LightOpSchema#

Version: 1

Computes the pairwise Euclidean or squared Euclidean distances between the rows of two rank-2 tensors.

Inputs

  • A (T): A rank-2 tensor with shape (M, N).

  • B (T): A rank-2 tensor with shape (K, N).

Outputs

  • C (T): The pairwise distances with shape (M, K).

Attributes

  • metric (STRING): Distance metric: sqeuclidean or euclidean. (optional, default: sqeuclidean)

Type constraints

  • T: Constrain inputs and output to float or double tensors. Allowed types: tensor(double), tensor(float).