Type ITestCase
Namespace tensorflow.test
Interfaces IPythonObjectContainer
Methods
- assertAllClose
- assertAllCloseAccordingToType
- assertAllEqual
- assertAllGreater
- assertAllGreaterEqual
- assertAllInRange
- assertAllInSet
- assertAllLess
- assertAllLessEqual
- assertArrayNear
- assertDeviceEqual
- assertDTypeEqual
- assertNDArrayNear
- assertNear
- assertProtoEquals
- assertProtoEqualsVersion
- assertShapeEqual
- assertStartsWith
- cached_session
- captureWritesToStream
- checkedThread
- evaluate
- session
- test_session
Public instance methods
object assertAllClose(object a, object b, object rtol, object atol, object msg)
object assertAllCloseAccordingToType(object a, object b, object rtol, object atol, object float_rtol, object float_atol, object half_rtol, object half_atol, object bfloat16_rtol, object bfloat16_atol, object msg)
object assertAllEqual(object a, object b, object msg)
object assertAllGreater(object a, object comparison_target)
object assertAllGreaterEqual(object a, object comparison_target)
object assertAllInRange(object target, object lower_bound, object upper_bound, object open_lower_bound, object open_upper_bound)
object assertAllInSet(object target, object expected_set)
object assertAllLess(object a, object comparison_target)
object assertAllLessEqual(object a, object comparison_target)
object assertArrayNear(object farray1, object farray2, object err, object msg)
Asserts that two float arrays are near each other. Checks that for all elements of farray1 and farray2
|f1 - f2| < err. Asserts a test failure if not.
Parameters
-
object
farray1 - a list of float values.
-
object
farray2 - a list of float values.
-
object
err - a float value.
-
object
msg - Optional message to report on failure.
object assertDeviceEqual(object device1, object device2, object msg)
object assertDTypeEqual(object target, object expected_dtype)
object assertNDArrayNear(object ndarray1, object ndarray2, object err, object msg)
Asserts that two numpy arrays have near values.
Parameters
-
object
ndarray1 - a numpy ndarray.
-
object
ndarray2 - a numpy ndarray.
-
object
err - a float. The maximum absolute difference allowed.
-
object
msg - Optional message to report on failure.
object assertNear(object f1, object f2, object err, object msg)
Asserts that two floats are near each other. Checks that |f1 - f2| < err and asserts a test failure
if not.
Parameters
-
object
f1 - A float value.
-
object
f2 - A float value.
-
object
err - A float value.
-
object
msg - An optional string message to append to the failure message.
object assertProtoEquals(object expected_message_maybe_ascii, object message, object msg)
Asserts that message is same as parsed expected_message_ascii. Creates another prototype of message, reads the ascii message into it and
then compares them using self._AssertProtoEqual().
Parameters
-
object
expected_message_maybe_ascii - proto message in original or ascii form.
-
object
message - the message to validate.
-
object
msg - Optional message to report on failure.
object assertProtoEqualsVersion(object expected, object actual, object producer, object min_consumer, object msg)
object assertShapeEqual(object np_array, object tf_tensor, object msg)
object assertStartsWith(object actual, object expected_start, object msg)
object cached_session(object graph, object config, object use_gpu, object force_gpu)
object captureWritesToStream(object stream)
object checkedThread(object target, object args, object kwargs)
object evaluate(object tensors)
Evaluates tensors and returns numpy values.
Parameters
-
object
tensors - A Tensor or a nested list/tuple of Tensors.
Returns
-
object
- tensors numpy values.