⌘K ctrl+k
Search Shortcut cmd + k | ctrl + k
DuckDB 2.0 ドキュメント 全文検索
per page, with , order by , clip by
Results of 1 - 3 of about 3 for torch (0.003 sec.)
Integration with PyTorch 11924
PyTorch tensors can be built from DuckDB query results by exporting each result batch as Apache Arrow . This pattern is useful when training or serving models on Parquet data because DuckDB can filter and project the input before the batche ... s are converted to tensors. Installation pip install -U duckdb numpy pyarrow torch DuckDB to PyTorch This example queries a Parquet-backed Arrow dataset, streams the result as RecordBatch objects and conve ... ile import duckdb import numpy as np import pyarrow as pa import pyarrow.dataset as ds import pyarrow.parquet as pq import torch base_path = pathlib.Path(tempfile.mkdtemp()) parquet_dir = base_path / "train" table = pa.table( { "feature_0": [0.1, 0.3, ... _0, feature_1, label FROM train_dataset WHERE label = 1 """).to_arrow_reader(batch_size=2) for batch in reader: features = torch.tensor( np.column_stack( [ batch.column(0).to_numpy(), batch.column(1).to_numpy(), ] ), dtype=torch.float32, ) labels = to ...
https://man.mtool.work/duckdb/2.0/guides/python/pytorch.html
Conversion between DuckDB and Python 8092
This page documents the rules for converting DuckDB results to Python and Python objects to DuckDB . Result Conversion: DuckDB Results to Python A result is read from a relation or, when using the DB-API / con.execute() , from the connectio ... () Apache Arrow to_arrow_table() , to_arrow_reader() to_arrow_table() , to_arrow_reader() , both make a copy Polars pl() PyTorch torch() torch() TensorFlow tf() tf() Relations are recommended for most conversion, except when you want to do row-based w ...
https://man.mtool.work/duckdb/2.0/clients/python/conversion.html
Python Client API 7868
Connection class duckdb. Appender Bases: object append_row ( self , * args ) → None Buffer one row, one value per column, each converted as an executemany parameter would be append_rows ( self , rows : object ) → None Buffer each row of an ... ill holds. to_arrow_table ( batch_size : int = 131072 ) → Any Every row the pending result still holds, as an Arrow Table. torch ( self ) → dict Fetch a result as dict of PyTorch Tensors following execute() type ( self , type_str : str ) → _duckdb._sq ... Creates a view named view_name that refers to the relation object. Detailed examples can be found at Relational API page . torch ( ) → dict [ str , Any ] Fetch a result as dict of PyTorch Tensors. Detailed examples can be found at Relational API page ... Tokenizes a SQL string, returning a list of (position, type) tuples that can be used for e.g., syntax highlighting duckdb. torch ( * , connection : _duckdb.DuckDBPyConnection | None = None ) → dict Fetch a result as dict of PyTorch Tensors following e ...
https://man.mtool.work/duckdb/2.0/clients/python/reference/
PREV 1 NEXT
DuckDB 2.0 Documentation / man.mtool.work