35 const Shape &unextended_input2_shape,
const T *input2_data,
36 const Shape &unextended_output_shape, T *output_data)
40 float operator()(
const float lhs,
const float rhs)
const {
return std::fmod(lhs, rhs); }
44 typename std::conditional<std::is_integral<T>::value, std::modulus<T>, FloatMod>::type;
47 throw std::runtime_error(std::string(
"cker::FloorModBroadcast: Unsupported rank size : ") +
67 auto in1_val = input1_data[in1_idx];
68 auto in2_val = input2_data[in2_idx];
71 T trunc_mod = mod_func(in1_val, in2_val);
72 output_data[out_idx] = (trunc_mod != 0) && ((in2_val < 0) != (trunc_mod < 0))
73 ? (trunc_mod + in2_val)
87 float operator()(
const float lhs,
const float rhs)
const {
return std::fmod(lhs, rhs); }
91 typename std::conditional<std::is_integral<T>::value, std::modulus<T>, FloatMod>::type;
94 for (
int t = 0; t < num_elements; t++)
97 auto in1_val = input1_data[t];
98 auto in2_val = input2_data[t];
99 T trunc_mod = mod_func(in1_val, in2_val);
101 (trunc_mod != 0) && ((in2_val < 0) != (trunc_mod < 0)) ? (trunc_mod + in2_val) : trunc_mod;
void FloorModBroadcast(const Shape &unextended_input1_shape, const T *input1_data, const Shape &unextended_input2_shape, const T *input2_data, const Shape &unextended_output_shape, T *output_data)