Home / Class/ binary_pred Class — pytorch Architecture

binary_pred Class — pytorch Architecture

Architecture documentation for the binary_pred class in vec_base.h from the pytorch codebase.

Entity Profile

Source Code

aten/src/ATen/cpu/vec/vec_base.h lines 695–707

  template <typename Op>
  inline Vectorized<T> binary_pred(const Vectorized<T>& other, Op op) const {
    // All bits are set to 1 if the pred is true, otherwise 0.
    Vectorized<T> vector;
    for (int64_t i = 0; i != size(); i++) {
      if (op(values[i], other.values[i])) {
        std::memset(static_cast<void*>(vector.values + i), 0xFF, sizeof(T));
      } else {
        std::memset(static_cast<void*>(vector.values + i), 0, sizeof(T));
      }
    }
    return vector;
  }

Analyze Your Own Codebase

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

Try Supermodel Free