dotProductGPU function
Calculates the dot product between vector a and b.
The operations are appended to tape for execution.
The operations are appended to tape for execution.
Implementation
GPUTensor<Scalar> dotProductGPU(
GPUTensor<Vector> a, GPUTensor<Vector> b, CommandBuffer tape,
{GPUTensor<Vector>? multipliedTensor, GPUTensor<Scalar>? outTensor}) {
GPUTensor<Vector> multiplied =
multiplyGPU<Vector>(a, b, tape, outTensor: multipliedTensor);
GPUTensor<Scalar> out = sumGPU(multiplied, tape, outTensor: outTensor);
out.subMap["multiplied"] = multiplied;
return out;
}