Skip to content

Commit c019b44

Browse files
hcurOceania2018
authored andcommitted
one down
1 parent dcd06e7 commit c019b44

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/TensorFlowNET.Core/Tensors/TensorShape.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,12 @@ public bool is_compatible_with(TensorShape shape2)
145145
{
146146
throw new NotImplementedException("TensorShape is_compatible_with");
147147
}
148+
149+
public void assert_has_rank(int rank)
150+
{
151+
if (rank != ndim)
152+
throw new ValueError(String.Format("Shape {0} must have rank {1}", ndim, rank));
153+
}
148154

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

0 commit comments

Comments
 (0)