tfm.utils.assert_rank
Stay organized with collections
Save and categorize content based on your preferences.
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.
|
[null,null,["Last updated 2026-11-06 UTC."],[],[]]