You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*_pool*d: improve error handling and error messages. (#9648)
This PR refactors `{avg,max}_pool{2,3}d` operation implementations by
improving their error message, and returning a status type value.
**Key Changes:**
- Make `tensor_methods::avg_pool_nd{,_backward}` return
`StatusOr<XLATensorPtr>`
- Make `tensor_methods::max_pool_nd{,_backward}` return
`StatusOr<std::tuple<XLATensorPtr, XLATensorPtr>>`
- Improve error messages and error handling
- Remove `CheckIntList`
- Create the following new functions:
- `RepeatIfSingleElement(span, n)`: if `span` is a single-element list,
create a new one repeating it `n` times. Otherwise return the elements
in `span`.
- ` CheckPoolNdInputHasSize(...)`: check that the given list has a
specific size
- ` FillAndCheckPoolNdInputs(...)`: runs the 2 functions above for
`*_pool*d` common inputs, i.e. `kernel_size`, `stride`, and `padding`
0 commit comments