Skip to content

Commit

Permalink
another way to calc size of buf item size, fixed the issue with mssd.…
Browse files Browse the repository at this point in the history
…tfile (#547)
  • Loading branch information
pinxue committed Feb 10, 2021
1 parent 2b85249 commit 9a0bcd4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pytengine/tengine/tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def buf(self, value):
:return: None
"""
_LIB.set_tensor_buffer.argtypes = [ctypes.c_void_p, ctypes.c_void_p, ctypes.c_int]
value_bytes = _LIB.data_type_size(_LIB.get_tensor_data_type(ctypes.c_void_p(self.tensor)))
value_bytes = ctypes.sizeof(Tengine_ctype[self.dtype.enum])
check_call(_LIB.set_tensor_buffer(self.tensor, np.ctypeslib.as_ctypes(value), value.size * value_bytes))

def getData(self):
Expand Down

0 comments on commit 9a0bcd4

Please sign in to comment.