mirror of
https://github.com/pybind/pybind11.git
synced 2026-06-06 06:51:58 +00:00
generate more compact binaries
This commit is contained in:
16
example/example10.py
Normal file
16
example/example10.py
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env python3
|
||||
import sys
|
||||
sys.path.append('.')
|
||||
|
||||
import example
|
||||
import numpy as np
|
||||
|
||||
from example import vectorized_func
|
||||
from example import vectorized_func2
|
||||
|
||||
for f in [vectorized_func, vectorized_func2]:
|
||||
print(f(1, 2, 3))
|
||||
print(f(np.array(1), np.array(2), 3))
|
||||
print(f(np.array([1, 3]), np.array([2, 4]), 3))
|
||||
print(f(np.array([[1, 3, 5], [7, 9, 11]]), np.array([[2, 4, 6], [8, 10, 12]]), 3))
|
||||
print(np.array([[1, 3, 5], [7, 9, 11]])* np.array([[2, 4, 6], [8, 10, 12]])*3)
|
||||
Reference in New Issue
Block a user