Skip to content

Commit 24f3020

Browse files
committed
fix TensorSharp.concatenate
1 parent 1252ea8 commit 24f3020

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

‎src/TensorFlowNET.Core/Tensors/TensorShape.cs‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,16 @@ public TensorShape concatenate(int[] other_)
6767
if (NDim < 0 || other.NDim < 0)
6868
return new TensorShape();
6969
else
70-
return new TensorShape(NDim + other.NDim);
70+
{
71+
var concatenate_dims = new int[NDim + other.NDim];
72+
for (int i = 0; i < NDim; i++)
73+
concatenate_dims[i] = dims[i];
74+
75+
for (int i = 0; i < other.NDim; i++)
76+
concatenate_dims[NDim + i] = other.dims[i];
77+
78+
return new TensorShape(concatenate_dims);
79+
}
7180
}
7281

7382
public static implicit operator TensorShape(int[] dims) => new TensorShape(dims);

0 commit comments

Comments
 (0)