mirror of
https://github.com/davrot/pytutorial.git
synced 2025-06-08 01:00:03 +02:00
Add files via upload
Signed-off-by: David Rotermund <54365609+davrot@users.noreply.github.com>
This commit is contained in:
parent
98f3657934
commit
0f74e9bb19
5 changed files with 522 additions and 0 deletions
27
PyBind11/basics/test.py
Normal file
27
PyBind11/basics/test.py
Normal file
|
@ -0,0 +1,27 @@
|
|||
from PyMyModuleCPU import MyModule
|
||||
import numpy as np
|
||||
|
||||
MyCExtension = MyModule()
|
||||
|
||||
X = np.random.random((5, 6))
|
||||
|
||||
print("X")
|
||||
print(X)
|
||||
|
||||
if MyCExtension.PutStuffIn(X) is False:
|
||||
print("Error (1)\n")
|
||||
exit()
|
||||
|
||||
Y = MyCExtension.GetStuffOut()
|
||||
|
||||
print("X-Y:")
|
||||
print(X - Y)
|
||||
|
||||
if MyCExtension.DoStuff(5.0) is False:
|
||||
print("Error (2)\n")
|
||||
exit()
|
||||
|
||||
Z = MyCExtension.GetStuffOut()
|
||||
|
||||
print("X*5-Z:")
|
||||
print(X * 5.0 - Z)
|
Loading…
Add table
Add a link
Reference in a new issue