Browse Source

fix TensorSharp.concatenate

tags/v0.12
Oceania2018 6 years ago
parent
commit
24f3020ddf
1 changed files with 10 additions and 1 deletions
  1. +10
    -1
      src/TensorFlowNET.Core/Tensors/TensorShape.cs

+ 10
- 1
src/TensorFlowNET.Core/Tensors/TensorShape.cs View File

@@ -67,7 +67,16 @@ namespace Tensorflow
if (NDim < 0 || other.NDim < 0)
return new TensorShape();
else
return new TensorShape(NDim + other.NDim);
{
var concatenate_dims = new int[NDim + other.NDim];
for (int i = 0; i < NDim; i++)
concatenate_dims[i] = dims[i];

for (int i = 0; i < other.NDim; i++)
concatenate_dims[NDim + i] = other.dims[i];

return new TensorShape(concatenate_dims);
}
}

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


Loading…
Cancel
Save