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

Method testPickle

tensorflow/python/eager/core_test.py:458–467  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

456 self.assertEquals(0, ctx.num_gpus())
457
458 def testPickle(self):
459 tmp_dir = self.get_temp_dir()
460 fname = os.path.join(tmp_dir, 't.pickle')
461 with open(fname, 'wb') as f:
462 t = constant_op.constant(10.0)
463 pickle.dump(t, f)
464
465 with open(fname, 'rb') as f:
466 t = pickle.load(f)
467 self.assertAllEqual(t.numpy(), 10.0)
468
469 @test_util.run_gpu_only
470 def testDevicePlacementEnforcesConsistency(self):

Callers

nothing calls this directly

Calls 7

get_temp_dirMethod · 0.80
joinMethod · 0.45
constantMethod · 0.45
dumpMethod · 0.45
loadMethod · 0.45
assertAllEqualMethod · 0.45
numpyMethod · 0.45

Tested by

no test coverage detected