(divident_type: Type, divisor_type: Type)
| 157 | |
| 158 | impl Types { |
| 159 | fn new(divident_type: Type, divisor_type: Type) -> Result<Self> { |
| 160 | let (dividend_no_bits_shape, _dividend_bits) = pop_last_dim(divident_type.get_dimensions()); |
| 161 | let (divisor_no_bits_shape, divisor_bits) = pop_last_dim(divisor_type.get_dimensions()); |
| 162 | let output_no_bits_shape = |
| 163 | broadcast_shapes(dividend_no_bits_shape.clone(), divisor_no_bits_shape)?; |
| 164 | let dividend_no_bits_shape = |
| 165 | prepend_dims(dividend_no_bits_shape, output_no_bits_shape.len())?; |
| 166 | let remainder_pulled_bits_shape = |
| 167 | [vec![divisor_bits], output_no_bits_shape.clone()].concat(); |
| 168 | let quotient_pulled_bit_shape = [vec![1], output_no_bits_shape.clone()].concat(); |
| 169 | let quotient_no_bits_shape = output_no_bits_shape; |
| 170 | Ok(Self { |
| 171 | divident_type, |
| 172 | divisor_type, |
| 173 | remainder_pulled_bits_type: array_type(remainder_pulled_bits_shape, BIT), |
| 174 | quotient_pulled_bit_type: array_type(quotient_pulled_bit_shape, BIT), |
| 175 | dividend_no_bits_type: array_type(dividend_no_bits_shape, BIT), |
| 176 | quotient_no_bits_type: array_type(quotient_no_bits_shape, BIT), |
| 177 | }) |
| 178 | } |
| 179 | } |
| 180 | |
| 181 | fn broadcast(node: Node, want_type: Type) -> Result<Node> { |
nothing calls this directly
no test coverage detected