Esempio n. 1
0
def populated_graph_db(
        request,
        opencl_relpaths: Set[str]) -> unlabelled_graph_database.Database:
    """A test fixture which yields a graph database with 256 OpenCL IR entries."""
    with testing_databases.DatabaseContext(graph_tuple_database.Database,
                                           request.param) as db:
        random_graph_tuple_database_generator.PopulateWithTestSet(
            db, len(opencl_relpaths))

        yield db
Esempio n. 2
0
def graph_db(
  request, opencl_relpaths: List[str], node_y_dimensionality: int,
) -> graph_tuple_database.Database:
  """A test fixture which yields a graph database with 100 real graphs."""
  with testing_databases.DatabaseContext(
    graph_tuple_database.Database, request.param
  ) as db:
    random_graph_tuple_database_generator.PopulateWithTestSet(
      db,
      len(opencl_relpaths),
      node_x_dimensionality=2,
      node_y_dimensionality=node_y_dimensionality,
      graph_x_dimensionality=0,
      graph_y_dimensionality=0,
      split_count=3,
    )
    yield db
Esempio n. 3
0
def graph_db(
    opencl_relpaths: List[str],
    graph_y_dimensionality: int,
) -> graph_tuple_database.Database:
    """A test fixture which yields a graph database with 256 OpenCL IR entries."""
    with testing_databases.DatabaseContext(
            graph_tuple_database.Database,
            testing_databases.GetDatabaseUrls()[0]) as db:
        random_graph_tuple_database_generator.PopulateWithTestSet(
            db,
            len(opencl_relpaths),
            node_x_dimensionality=2,
            node_y_dimensionality=0,
            graph_x_dimensionality=2,
            graph_y_dimensionality=graph_y_dimensionality,
            split_count=3,
        )
        yield db