inline bool is_compatible_stat()

in include/checks.h [46:59]


inline bool is_compatible_stat(const at::Tensor& x, const at::Tensor& s) {
  // Dimensions check
  bool success = s.ndimension() == 1;
  success &= x.size(1) == s.size(0);

  // Typing check
  if (x.scalar_type() == at::ScalarType::Half) {
    success &= s.scalar_type() == at::ScalarType::Float;
  } else {
    success &= x.scalar_type() == s.scalar_type();
  }

  return success;
}