mirror of
https://github.com/pybind/pybind11.git
synced 2026-05-13 01:36:21 +00:00
ability to prevent force casts in numpy arguments
This commit is contained in:
@@ -27,3 +27,8 @@ for f in [vectorized_func, vectorized_func2]:
|
||||
print(f(np.array([[1, 2, 3], [4, 5, 6]]), np.array([[2], [3]]), 2))
|
||||
print(np.array([[1, 2, 3], [4, 5, 6]])* np.array([[2], [3]])* 2)
|
||||
|
||||
from example import selective_func
|
||||
|
||||
selective_func(np.array([1], dtype=np.int32))
|
||||
selective_func(np.array([1.0], dtype=np.float32))
|
||||
selective_func(np.array([1.0j], dtype=np.complex64))
|
||||
|
||||
Reference in New Issue
Block a user