Skip to content

Commit

Permalink
Include checks
Browse files Browse the repository at this point in the history
  • Loading branch information
frostedoyster committed Nov 10, 2023
1 parent da9bf03 commit 8cf2d79
Showing 1 changed file with 14 additions and 30 deletions.
44 changes: 14 additions & 30 deletions mops/src/hpe/cpu.tpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,37 +13,21 @@ void mops::homogeneous_polynomial_evaluation(
Tensor<int32_t, 2> p
) {

// if (tensor_a.shape[0] != tensor_b.shape[0]) {
// throw std::runtime_error(
// "A and B tensors must have the same number of elements along the "
// "first dimension, got " + std::to_string(tensor_a.shape[0]) + " and " +
// std::to_string(tensor_b.shape[0])
// );
// }

// if (tensor_a.shape[0] != output.shape[0]) {
// throw std::runtime_error(
// "O must contain the same number of elements as the first "
// "dimension of A and B , got " + std::to_string(output.shape[0]) +
// " and " + std::to_string(tensor_a.shape[0])
// );
// }

// if (tensor_c.shape[0] != p_b.shape[0]) {
// throw std::runtime_error(
// "the dimension of C must match that of P_B, got "
// + std::to_string(tensor_c.shape[0]) +
// " for C and " + std::to_string(p_b.shape[0]) + " for P_B"
// );
// }
if (tensor_a.shape[0] != output.shape[0]) {
throw std::runtime_error(
"A and O tensors must have the same number of elements along the "
"first dimension, got " + std::to_string(tensor_a.shape[0]) + " and " +
std::to_string(output.shape[0])
);
}

// if (tensor_c.shape[0] != p_o.shape[0]) {
// throw std::runtime_error(
// "the dimension of C must match that of P_O, got "
// + std::to_string(tensor_c.shape[0]) +
// " for C and " + std::to_string(p_o.shape[0]) + " for P_O"
// );
// }
if (tensor_c.shape[0] != p.shape[0]) {
throw std::runtime_error(
"C and P tensors must have the same number of elements along the "
"first dimension, got " + std::to_string(tensor_c.shape[0]) + " and " +
std::to_string(p.shape[0])
);
}

scalar_t* o_ptr = output.data;
scalar_t* a_ptr = tensor_a.data;
Expand Down

0 comments on commit 8cf2d79

Please sign in to comment.