Open
Description
hi, https://github.com/LaurentMazare/tch-rs/blob/main/src/tensor/index.rs#L336 any thoughts on using f_select
here and propagate the error instead of select
which panics ?
f_indexer is suppose to return Result<Tensor>
but the usage of select
means that it will panic instead of propagating an error.
pub fn select(&self, dim: i64, index: i64) -> Tensor {
self.f_select(dim, index).unwrap()
}
why not directly have f_select there and propagate the error upwards
The purpose of having f_i
is so that it allows the user to handle the indexing error, but if we panic, then there's no point in having fn f_i
Metadata
Assignees
Labels
No labels
Activity