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

Method OpTest

tensorflow/compiler/tests/randomized_tests.cc:368–390  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

366};
367
368OpTest::OpTest() {
369 // Creates a random-number generator for the test case. Use the value of
370 // --tf_xla_random_seed as the seed, if provided.
371 int64 s = tf_xla_random_seed;
372 unsigned int seed;
373 if (s <= 0) {
374 std::random_device random_device;
375 seed = random_device();
376 } else {
377 seed = static_cast<unsigned int>(s);
378 }
379 LOG(ERROR) << "Random seed for test case: " << seed
380 << ". To reproduce the "
381 "results of this test, pass flag --tf_xla_random_seed="
382 << seed;
383 generator_.reset(new std::mt19937(seed));
384
385 // Create a session with an empty graph.
386 SessionOptions session_options;
387 session_.reset(NewSession(session_options));
388 GraphDef def;
389 TF_CHECK_OK(session_->Create(def));
390}
391
392void OpTest::Repeatedly(const std::function<TestResult(void)>& fn) {
393 int const max_repetitions = tf_xla_test_repetitions;

Callers

nothing calls this directly

Calls 3

NewSessionFunction · 0.50
resetMethod · 0.45
CreateMethod · 0.45

Tested by

no test coverage detected