Exemplo n.º 1
0
 def _createSqlDataset(self, output_types, num_repeats=1):
   dataset = readers.SqlDataset(self.driver_name, self.data_source_name,
                                self.query, output_types).repeat(num_repeats)
   iterator = dataset.make_initializable_iterator()
   init_op = iterator.initializer
   get_next = iterator.get_next()
   return init_op, get_next
 def _createSqlDataset(self,
                       query,
                       output_types,
                       driver_name="sqlite",
                       num_repeats=1):
   dataset = readers.SqlDataset(driver_name, self.data_source_name, query,
                                output_types).repeat(num_repeats)
   return dataset
 def _build_dataset(self, num_repeats):
   data_source_name = os.path.join(test.get_temp_dir(), "tftest.sqlite")
   driver_name = array_ops.placeholder_with_default(
       array_ops.constant("sqlite", dtypes.string), shape=[])
   query = ("SELECT first_name, last_name, motto FROM students ORDER BY "
            "first_name DESC")
   output_types = (dtypes.string, dtypes.string, dtypes.string)
   return readers.SqlDataset(driver_name, data_source_name, query,
                             output_types).repeat(num_repeats)