Skip to content

Commit aacc9db

Browse files
authored
BUG: testing: convert torch tensors with conjugate bit set to NumPy (#744)
Signed-off-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com> Co-authored-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com>
1 parent 2ec7cf5 commit aacc9db

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/array_api_extra/_lib/_testing.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ def as_numpy_array(array: Array, *, xp: ModuleType) -> np.typing.NDArray[Any]:
124124
return array.todense() # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
125125

126126
if is_torch_namespace(xp):
127+
array.resolve_conj() # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]
127128
array = to_device(array, "cpu")
128129
if is_array_api_strict_namespace(xp):
129130
cpu: Device = xp.Device("CPU_DEVICE")

0 commit comments

Comments
 (0)