⌘K ctrl+k
Search Shortcut cmd + k | ctrl + k
DuckDB 2.0 ドキュメント 全文検索
per page, with , order by , clip by
Results of 1 - 1 of about 1 for tensor (0.001 sec.)
Integration with PyTorch 9414
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 dat ... aset, streams the result as RecordBatch objects and converts each batch into feature and label tensors. import pathlib import tempfile import duckdb import numpy as np import pyarrow as pa import pyarrow.dataset as ds import ... ature_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 = torch.ten ...
https://man.mtool.work/duckdb/2.0/guides/python/pytorch.html
PREV 1 NEXT
DuckDB 2.0 Documentation / man.mtool.work