| assert_rank | R Documentation |
Throws an error if the tensor rank is not of the expected rank.
assert_rank(tensor, expected_rank, name = NULL)
tensor |
A tf.Tensor to check the rank of. |
expected_rank |
Integer vector or list of integers, expected rank. |
name |
Optional name of the tensor for the error message. |
TRUE if the Tensor is of the expected rank (error otherwise).
## Not run:
with(tensorflow::tf$variable_scope("examples",
reuse = tensorflow::tf$AUTO_REUSE
), {
ids <- tensorflow::tf$get_variable("x", dtype = "int32", shape = 10L)
assert_rank(ids, 1)
assert_rank(ids, 1:2)
assert_rank(ids, 2)
})
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.