提交 8e6d7254 编写于 作者: T TeslaZhao

fix a bug for pipeline packing

上级 8f5c838b
...@@ -127,7 +127,6 @@ class ChannelData(object): ...@@ -127,7 +127,6 @@ class ChannelData(object):
def get_size(self): def get_size(self):
size = 0 size = 0
dict_data = None
if isinstance(self.dictdata, dict): if isinstance(self.dictdata, dict):
for k in self.dictdata: for k in self.dictdata:
size += sys.getsizeof(self.dictdata[k]) + sys.getsizeof(k) size += sys.getsizeof(self.dictdata[k]) + sys.getsizeof(k)
......
...@@ -108,7 +108,9 @@ class PipelineClient(object): ...@@ -108,7 +108,9 @@ class PipelineClient(object):
if isinstance(value, np.ndarray): if isinstance(value, np.ndarray):
# copy shape # copy shape
_LOGGER.info("value shape is {}".format(value.shape)) _LOGGER.debug(
"key:{}, use_tensor_bytes:{}, value.shape:{}, value.dtype:{}".
format(key, use_tensor_bytes, value.shape, value.dtype))
for one_dim in value.shape: for one_dim in value.shape:
one_tensor.shape.append(one_dim) one_tensor.shape.append(one_dim)
...@@ -118,6 +120,7 @@ class PipelineClient(object): ...@@ -118,6 +120,7 @@ class PipelineClient(object):
np.save(np_bytes, value, allow_pickle=True) np.save(np_bytes, value, allow_pickle=True)
one_tensor.byte_data = np_bytes.getvalue() one_tensor.byte_data = np_bytes.getvalue()
one_tensor.elem_type = 13 #13 => bytes in proto one_tensor.elem_type = 13 #13 => bytes in proto
continue
flat_value = value.flatten().tolist() flat_value = value.flatten().tolist()
# copy data # copy data
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册