pytutorial/PyBind11/basics/test.py
David Rotermund 0f74e9bb19
Add files via upload
Signed-off-by: David Rotermund <54365609+davrot@users.noreply.github.com>
2024-01-03 14:47:16 +01:00

27 lines
413 B
Python

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)