Skip to content

Commit 7f4ed1f

Browse files
committed
tf.rank SciSharp#396
1 parent 4c2090c commit 7f4ed1f

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/TensorFlowNET.Core/APIs/tf.array.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,15 @@ public Tensor where<Tx, Ty>(Tensor condition, Tx x, Ty y, string name = null)
8484
public Tensor transpose<T1>(T1 a, int[] perm = null, string name = "transpose", bool conjugate = false)
8585
=> array_ops.transpose(a, perm, name, conjugate);
8686

87+
/// <summary>
88+
/// Returns the rank of a tensor.
89+
/// </summary>
90+
/// <param name="input"></param>
91+
/// <param name="name"></param>
92+
/// <returns>Returns a 0-D `int32` `Tensor` representing the rank of `input`.</returns>
93+
public Tensor rank(Tensor input, string name = null)
94+
=> array_ops.rank(input, name: name);
95+
8796
public Tensor squeeze(Tensor input, int[] axis = null, string name = null, int squeeze_dims = -1)
8897
=> gen_array_ops.squeeze(input, axis, name);
8998

0 commit comments

Comments
 (0)