get_shape_list | R Documentation |
Returns a list of the shape of tensor, preferring static dimensions. (A static dimension is known at graph definition time, and a dynamic dimension is known only at graph execution time.) https://stackoverflow.com/questions/37096225/
get_shape_list(tensor, expected_rank = NULL, name = NULL)
tensor |
A tf.Tensor object to find the shape of. |
expected_rank |
The expected rank of |
name |
Optional name of the tensor for the error message. |
A list of dimensions of the shape of tensor. All static dimensions will be returned as native integers, and dynamic dimensions will be returned as tf.Tensor scalars. (I'm not very comfortable with this behavior. It's not usually good practice to make the return type vary depending on the input.)
## Not run: with(tensorflow::tf$variable_scope("examples", reuse = tensorflow::tf$AUTO_REUSE ), { phx <- tensorflow::tf$placeholder(tensorflow::tf$int32, shape = c(4)) get_shape_list(phx) # static tfu <- tensorflow::tf$unique(phx) tfy <- tfu$y get_shape_list(tfy) # dynamic }) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.