diff --git a/lite/pylite/megenginelite/tensor.py b/lite/pylite/megenginelite/tensor.py index 0af8f27fb7cfcaf5a470a2213bdf426c5aabc0b5..ef86154f01be4fa124d96cecf3c702428a9796de 100644 --- a/lite/pylite/megenginelite/tensor.py +++ b/lite/pylite/megenginelite/tensor.py @@ -421,7 +421,8 @@ class LiteTensor(object): """ self.update() if self.nbytes <= 0: - return np.array([]) + np_type = _lite_type_to_nptypes[LiteDataType(self._layout.data_type)] + return np.array([], dtype=np_type) if self.is_continue and ( self.is_pinned_host or self.device_type == LiteDeviceType.LITE_CPU ):