huggingface / candle

Minimalist ML framework for Rust
Apache License 2.0
15.03k stars 875 forks source link

Extension request: How to construct Tensor for n-dimensional Vec #1585

Open BDUG opened 7 months ago

BDUG commented 7 months ago

How do I best create a Tensor from a &Vec<Vec> type? Everything above 1D is quite hard to manage for index based value setting.

EricLBuehler commented 7 months ago

You could create 1D tensors and then .cat to create the final 2D tensor.