Home / Class/ dot_naive Class — pytorch Architecture

dot_naive Class — pytorch Architecture

Architecture documentation for the dot_naive class in BlasKernel.cpp from the pytorch codebase.

Entity Profile

Source Code

aten/src/ATen/native/BlasKernel.cpp lines 653–667

template <typename scalar_t, typename Functor>
static scalar_t dot_naive(
    int64_t n,
    const scalar_t* x,
    int64_t incx,
    const scalar_t* y,
    int64_t incy,
    Functor op) {
  using opmath_t = at::opmath_type<scalar_t>;
  opmath_t sum = 0;
  for (int64_t i = 0; i < n; i++) {
    sum += op(static_cast<opmath_t>(x[i * incx]), static_cast<opmath_t>(y[i * incy]));
  }
  return static_cast<scalar_t>(sum);
}

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free