Browse Source

one down

tags/v0.20
carb0n Haiping 5 years ago
parent
commit
c019b44918
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      src/TensorFlowNET.Core/Tensors/TensorShape.cs

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

@@ -145,6 +145,12 @@ namespace Tensorflow
{ {
throw new NotImplementedException("TensorShape is_compatible_with"); throw new NotImplementedException("TensorShape is_compatible_with");
} }
public void assert_has_rank(int rank)
{
if (rank != ndim)
throw new ValueError(String.Format("Shape {0} must have rank {1}", ndim, rank));
}


[SuppressMessage("ReSharper", "ParameterHidesMember")] [SuppressMessage("ReSharper", "ParameterHidesMember")]
public TensorShape with_rank_at_least(int rank) public TensorShape with_rank_at_least(int rank)


Loading…
Cancel
Save