Exemplo n.º 1
0
 def _to_proto(self):
   pb = dataset_options_pb2.ThreadingOptions()
   if self.max_intra_op_parallelism is not None:
     pb.max_intra_op_parallelism = self.max_intra_op_parallelism
   if self.private_threadpool_size is not None:
     pb.private_threadpool_size = self.private_threadpool_size
   return pb
Exemplo n.º 2
0
 def testProtoOptionsDefaultValuesRoundTrip(self):
     pb = dataset_options_pb2.Options()
     options = dataset_ops.Options()
     options._from_proto(pb)
     result = options._to_proto()
     expected_pb = dataset_options_pb2.Options()
     expected_pb.distribute_options.CopyFrom(
         dataset_options_pb2.DistributeOptions())
     expected_pb.optimization_options.CopyFrom(
         dataset_options_pb2.OptimizationOptions())
     expected_pb.threading_options.CopyFrom(
         dataset_options_pb2.ThreadingOptions())
     self.assertProtoEquals(expected_pb, result)