(array, like)
| 74 | |
| 75 | |
| 76 | def to_like_array(array, like): |
| 77 | # Mostly for cupy compatibility, because cupy binary ops require all cupy arrays |
| 78 | xp = get_array_namespace(like) |
| 79 | if xp is not np: |
| 80 | return xp.asarray(array) |
| 81 | # avoid casting things like pint quantities to numpy arrays |
| 82 | return array |
no test coverage detected
searching dependent graphs…