Skip to content

Commit

Permalink
python pipeline support lod input
Browse files Browse the repository at this point in the history
  • Loading branch information
TeslaZhao committed Nov 8, 2021
1 parent c28fbc6 commit a3ab610
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions python/pipeline/pipeline_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@ def _pack_request_package(self, feed_dict, pack_tensor_format,
else:
# pack tensor format
for key, value in feed_dict.items():

# skipping the lod feed_var.
# The declare of lod feed_var must be hebind the feed_var.
if ".lod" in key:
continue

one_tensor = req.tensors.add()
one_tensor.name = key

Expand All @@ -114,6 +120,13 @@ def _pack_request_package(self, feed_dict, pack_tensor_format,
for one_dim in value.shape:
one_tensor.shape.append(one_dim)

# set lod info, must be list type.
lod_key = key + ".lod"
if lod_key in feed_dict:
lod_list = feed_dict.get(lod_key)
if lod_list is not None:
one_tensor.lod.extend(lod_list)

# packed into bytes
if use_tensor_bytes is True:
np_bytes = BytesIO()
Expand Down

0 comments on commit a3ab610

Please sign in to comment.