PyDP
PyDP copied to clipboard
Test datatype for when passed for compuation
Description
When we call the result function, we just pass the python list as it is.
x = pydp.BoundedMean(1.0)
x.result([1,2,3,4])
What would be great is mention the datatype of the list in another argument,
x.result([1,2,3,4], 'int')
We want the new function definition to have the datatype as one of the argument, with float as the default argument.
Note: The function definition of result below is for representation purpose and the original code will be in c++ (pybind11).
def result(list, datatype= 'float'):
pass
The idea behind doing this is if we know the datatype, the underlying c++ code can become a lot efficient as right now, we are just converting everything to float.
Are we planning to do this for every function ?
Yes
On Wed, 29 Jul 2020 at 18:28, Saksham [email protected] wrote:
Are we planning to do this for every function ?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/OpenMined/PyDP/issues/204#issuecomment-665647901, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACTTOFMGXH4GOEEYZE5AP3LR6AMGJANCNFSM4PK6LODQ .
-- Regards
Chinmay Shah
I can take this up, I will try to add them for the util functions first and we can expand from it If everything works as expected .
We have already added datatype in #249 . We just need to make sure we do the cast, at the same time raise a warning.