MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / test_trace

Function test_trace

tensorflow/python/ops/linalg/linear_operator_test_util.py:495–505  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

493
494def _test_trace(use_placeholder, shapes_info, dtype):
495 def test_trace(self):
496 with self.session(graph=ops.Graph()) as sess:
497 sess.graph.seed = random_seed.DEFAULT_GRAPH_SEED
498 operator, mat = self.operator_and_matrix(
499 shapes_info, dtype, use_placeholder=use_placeholder)
500 op_trace = operator.trace()
501 mat_trace = math_ops.trace(mat)
502 if not use_placeholder:
503 self.assertAllEqual(op_trace.shape, mat_trace.shape)
504 op_trace_v, mat_trace_v = sess.run([op_trace, mat_trace])
505 self.assertAC(op_trace_v, mat_trace_v)
506 return test_trace
507
508

Callers

nothing calls this directly

Calls 7

assertACMethod · 0.80
sessionMethod · 0.45
GraphMethod · 0.45
operator_and_matrixMethod · 0.45
traceMethod · 0.45
assertAllEqualMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected