2424
2525class CommonVideoTest (tf .test .TestCase ):
2626
27- def runScheduledSampleFunc (self , func , var , batch_size ):
27+ def _run_scheduled_sample_func (self , func , var , batch_size ):
2828 ground_truth_x = list (range (1 , batch_size + 1 ))
2929 generated_x = [- x for x in ground_truth_x ]
3030 ground_truth_x = tf .convert_to_tensor (ground_truth_x )
@@ -35,39 +35,39 @@ def runScheduledSampleFunc(self, func, var, batch_size):
3535
3636 @tf .contrib .eager .run_test_in_graph_and_eager_modes ()
3737 def testScheduledSampleProbStart (self ):
38- ground_truth_x , _ , ss_out = self .runScheduledSampleFunc (
38+ ground_truth_x , _ , ss_out = self ._run_scheduled_sample_func (
3939 common_video .scheduled_sample_prob , 1.0 , 10 )
4040 self .assertAllEqual (ground_truth_x , ss_out )
4141
4242 @tf .contrib .eager .run_test_in_graph_and_eager_modes ()
4343 def testScheduledSampleProbMid (self ):
44- _ , _ , ss_out = self .runScheduledSampleFunc (
44+ _ , _ , ss_out = self ._run_scheduled_sample_func (
4545 common_video .scheduled_sample_prob , 0.5 , 1000 )
4646 positive_count = np .sum (ss_out > 0 )
4747 self .assertAlmostEqual (positive_count / 1000.0 , 0.5 , places = 1 )
4848
4949 @tf .contrib .eager .run_test_in_graph_and_eager_modes ()
5050 def testScheduledSampleProbEnd (self ):
51- _ , generated_x , ss_out = self .runScheduledSampleFunc (
51+ _ , generated_x , ss_out = self ._run_scheduled_sample_func (
5252 common_video .scheduled_sample_prob , 0.0 , 10 )
5353 self .assertAllEqual (generated_x , ss_out )
5454
5555 @tf .contrib .eager .run_test_in_graph_and_eager_modes ()
5656 def testScheduledSampleCountStart (self ):
57- ground_truth_x , _ , ss_out = self .runScheduledSampleFunc (
57+ ground_truth_x , _ , ss_out = self ._run_scheduled_sample_func (
5858 common_video .scheduled_sample_count , 10 , 10 )
5959 self .assertAllEqual (ground_truth_x , ss_out )
6060
6161 @tf .contrib .eager .run_test_in_graph_and_eager_modes ()
6262 def testScheduledSampleCountMid (self ):
63- _ , _ , ss_out = self .runScheduledSampleFunc (
63+ _ , _ , ss_out = self ._run_scheduled_sample_func (
6464 common_video .scheduled_sample_count , 5 , 10 )
6565 positive_count = np .sum (ss_out > 0 )
6666 self .assertEqual (positive_count , 5 )
6767
6868 @tf .contrib .eager .run_test_in_graph_and_eager_modes ()
6969 def testScheduledSampleCountEnd (self ):
70- _ , generated_x , ss_out = self .runScheduledSampleFunc (
70+ _ , generated_x , ss_out = self ._run_scheduled_sample_func (
7171 common_video .scheduled_sample_count , 0 , 10 )
7272 self .assertAllEqual (generated_x , ss_out )
7373
0 commit comments