wkcn / MobulaOP

A Simple & Flexible Cross Framework Operators Toolkit
MIT License
164 stars 21 forks source link

Question on Example on PyTorch #55

Closed AlexHu123 closed 4 years ago

AlexHu123 commented 4 years ago

HI, I have tried your basic example on mulelementwise, but got this kind of error.

Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/alexhu/Source/MobulaOP/mobula/glue/common.py", line 158, in __call__ return backend.op_gen(glue_mod, op=self.op, name=self.name)(*args, **new_kwargs) File "/home/alexhu/Source/MobulaOP/mobula/glue/th.py", line 41, in __call__ return self.cache[self.name](*pars[0], **pars[1])(*inputs) File "/home/alexhu/anaconda3/envs/slr/lib/python3.6/site-packages/torch/nn/modules/module.py", line 547, in __call__ result = self.forward(*input, **kwargs) File "/home/alexhu/Source/MobulaOP/mobula/glue/th.py", line 105, in forward return torch_func.apply(self, *args, **kwargs) File "/home/alexhu/Source/MobulaOP/mobula/glue/th.py", line 59, in forward out = self._forward(*args, **kwargs) File "/home/alexhu/Source/MobulaOP/docs/tutorial/MulElemWise/MulElemWise.py", line 7, in forward mobula.func.mul_elemwise(a.size, a, b, self.y) File "/home/alexhu/Source/MobulaOP/mobula/func.py", line 148, in __call__ data, var_dev_id, ctype = self._get_scalar_info(var, ptype) File "/home/alexhu/Source/MobulaOP/mobula/func.py", line 277, in _get_scalar_info var, ctypes.c_void_p) else ptype.ctype(var) TypeError: an integer is required (got type builtin_function_or_method)

wkcn commented 4 years ago

Thank you for the report : ) I will check it.

wkcn commented 4 years ago

I have found the bug, and I'm fixing it. I will update the code after the bug fixed. Thanks for your support!

wkcn commented 4 years ago

Hi @AlexHu123 , I have fixed the bug : )

AlexHu123 commented 4 years ago

Thanks for your quick reply !