Create broadcast compatible variables, with the same dimensions. Unlike the result of broadcast_variables(), some variables may have dimensions of size 1 instead of the size of the broadcast dimension.
(*variables)
| 3028 | |
| 3029 | |
| 3030 | def _broadcast_compat_variables(*variables): |
| 3031 | """Create broadcast compatible variables, with the same dimensions. |
| 3032 | |
| 3033 | Unlike the result of broadcast_variables(), some variables may have |
| 3034 | dimensions of size 1 instead of the size of the broadcast dimension. |
| 3035 | """ |
| 3036 | dims = tuple(_unified_dims(variables)) |
| 3037 | return tuple(var.set_dims(dims) if var.dims != dims else var for var in variables) |
| 3038 | |
| 3039 | |
| 3040 | def broadcast_variables(*variables: Variable) -> tuple[Variable, ...]: |
no test coverage detected
searching dependent graphs…