View source on GitHub |
Raises an exception if the tensor rank is not of the expected rank.
tfm.utils.assert_rank(
tensor, expected_rank, name=None
)
Args | |
---|---|
tensor
|
A tf.Tensor to check the rank of. |
expected_rank
|
Python integer or list of integers, expected rank. |
name
|
Optional name of the tensor for the error message. |
Raises | |
---|---|
ValueError
|
If the expected shape doesn't match the actual shape. |