From e532a077b95d76a672ca09a00b54b35679a94d58 Mon Sep 17 00:00:00 2001 From: Evgeni Burovski Date: Thu, 16 Mar 2023 17:52:00 +0300 Subject: [PATCH 1/2] MAINT: add several missing aliases --- torch_np/_detail/_binary_ufuncs.py | 2 +- torch_np/_detail/_unary_ufuncs.py | 2 ++ torch_np/_dtypes.py | 3 +++ torch_np/tests/test_basic.py | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/torch_np/_detail/_binary_ufuncs.py b/torch_np/_detail/_binary_ufuncs.py index fbdff059..122871c4 100644 --- a/torch_np/_detail/_binary_ufuncs.py +++ b/torch_np/_detail/_binary_ufuncs.py @@ -38,7 +38,7 @@ not_equal, ) from torch import pow as power -from torch import remainder, subtract +from torch import remainder, subtract, true_divide from . import _dtypes_impl, _util diff --git a/torch_np/_detail/_unary_ufuncs.py b/torch_np/_detail/_unary_ufuncs.py index e482e85f..4c4afa6c 100644 --- a/torch_np/_detail/_unary_ufuncs.py +++ b/torch_np/_detail/_unary_ufuncs.py @@ -7,6 +7,7 @@ # renames from torch import absolute as fabs from torch import arccos, arccosh, arcsin, arcsinh, arctan, arctanh +from torch import bitwise_not from torch import bitwise_not as invert from torch import ceil from torch import conj_physical as conjugate @@ -31,6 +32,7 @@ from torch import rad2deg from torch import rad2deg as degrees from torch import reciprocal +from torch import round as fix from torch import round as rint from torch import sign, signbit, sin, sinh, sqrt, square, tan, tanh, trunc diff --git a/torch_np/_dtypes.py b/torch_np/_dtypes.py index c40cf48a..ba2bd8e0 100644 --- a/torch_np/_dtypes.py +++ b/torch_np/_dtypes.py @@ -174,7 +174,10 @@ class bool_(generic): "double": float64, "float_": float64, "csingle": complex64, + "singlecomplex": complex64, "cdouble": complex128, + "cfloat": complex128, + "complex_": complex128, } for name, obj in _name_aliases.items(): globals()[name] = obj diff --git a/torch_np/tests/test_basic.py b/torch_np/tests/test_basic.py index f6fab76d..bfeb592c 100644 --- a/torch_np/tests/test_basic.py +++ b/torch_np/tests/test_basic.py @@ -45,6 +45,7 @@ ufunc_names = _unary_ufuncs.__all__ ufunc_names.remove("invert") # torch: bitwise_not_cpu not implemented for 'Float' +ufunc_names.remove("bitwise_not") one_arg_funcs += [getattr(_unary_ufuncs, name) for name in ufunc_names] From 728b5c19dd963ec942e7cdf547ec314a376b1d3f Mon Sep 17 00:00:00 2001 From: Evgeni Burovski Date: Sun, 19 Mar 2023 18:13:20 +0300 Subject: [PATCH 2/2] MAINT: add tnp.mod (== tnp.remainder) --- torch_np/_detail/_binary_ufuncs.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/torch_np/_detail/_binary_ufuncs.py b/torch_np/_detail/_binary_ufuncs.py index 122871c4..592d8513 100644 --- a/torch_np/_detail/_binary_ufuncs.py +++ b/torch_np/_detail/_binary_ufuncs.py @@ -38,7 +38,9 @@ not_equal, ) from torch import pow as power -from torch import remainder, subtract, true_divide +from torch import remainder +from torch import remainder as mod +from torch import subtract, true_divide from . import _dtypes_impl, _util