Browse Source

TensorShape.this[...]: fixed guard check.

tags/v0.12
Eli Belash 6 years ago
parent
commit
44adad6d92
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      src/TensorFlowNET.Core/Tensors/TensorShape.cs

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

@@ -76,8 +76,8 @@ namespace Tensorflow
{
get
{
if (slice.IsIndex == false)
throw new ArgumentException("Slice must be an index.");
if (slice.Start.HasValue == false || slice.Length.HasValue == false)
throw new ArgumentException("Slice must has Start and Length.");

return new TensorShape(dims.Skip(slice.Start.Value)
.Take(slice.Length.Value)


Loading…
Cancel
Save