Note: This differs from Tensor.set_shape in that it sets the static shape
of the resulting tensor and enforces it at runtime, raising an error if the
tensor's runtime shape is incompatible with the specified shape.
Tensor.set_shape sets the static shape of the tensor without enforcing it
at runtime, which may result in inconsistencies between the statically-known
shape of tensors and the runtime value of tensors.

Args

x

A Tensor.

shape

A TensorShape representing the shape of this tensor, a
TensorShapeProto, a list, a tuple, or None.