Concat axis=0

Summary: Previously, the code below would go out of bound.

Reviewed By: xianjiec

Differential Revision: D4968037

fbshipit-source-id: 3760e2cddc919c45d85ac644ac3fabf72dbaf666
This commit is contained in:
Kittipat Virochsiri 2017-05-01 12:16:08 -07:00 committed by Facebook Github Bot
parent 1040b5f91c
commit ffc6bad116

View File

@ -33,6 +33,13 @@ class Concat(ModelLayer):
"Concat expects that limited dimensions of the input tensor"
shapes.append(list(field_type.field_type().shape))
if axis == 0:
self.output_schema = schema.from_blob_list(
input_record[0],
[model.net.NextScopedBlob(name + '_output')]
)
return
concat_dim = 0
for shape in shapes:
concat_dim += shape[axis - 1]