Aliases:
tf.assert_scalar
tf.contrib.framework.assert_scalar
tf.debugging.assert_scalar
tf.debugging.assert_scalar(
tensor,
name=None,
message=None
)
Defined in tensorflow/python/ops/check_ops.py
.
Asserts that the given tensor
is a scalar.
This function raises ValueError
unless it can be certain that the given
tensor
is a scalar. ValueError
is also raised if the shape of tensor
is
unknown.
Args:
tensor
: ATensor
.name
: A name for this operation. Defaults to "assert_scalar"message
: A string to prefix to the default message.
Returns:
The input tensor (potentially converted to a Tensor
).
Raises:
ValueError
: If the tensor is not scalar (rank 0), or if its shape is unknown.