diff options
author | Laurent Mazare <laurent.mazare@gmail.com> | 2023-12-17 05:20:05 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-17 05:20:05 -0600 |
commit | 1e86717bf274c6a0380f56f195727812e49f80a2 (patch) | |
tree | 10ced030940fa76dac22e86af8204b886ea352d3 /candle-pyo3/src/lib.rs | |
parent | c630622a071756860499ea7914d3a032a47be1b0 (diff) | |
download | candle-1e86717bf274c6a0380f56f195727812e49f80a2.tar.gz candle-1e86717bf274c6a0380f56f195727812e49f80a2.tar.bz2 candle-1e86717bf274c6a0380f56f195727812e49f80a2.zip |
Fix a couple typos (#1451)
* Mixtral quantized instruct.
* Fix a couple typos.
Diffstat (limited to 'candle-pyo3/src/lib.rs')
-rw-r--r-- | candle-pyo3/src/lib.rs | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/candle-pyo3/src/lib.rs b/candle-pyo3/src/lib.rs index ade00012..90826b98 100644 --- a/candle-pyo3/src/lib.rs +++ b/candle-pyo3/src/lib.rs @@ -212,7 +212,7 @@ trait MapDType { enum Indexer { Index(usize), Slice(usize, usize), - Elipsis, + Ellipsis, Expand, IndexSelect(Tensor), } @@ -568,7 +568,7 @@ impl PyTensor { "Ellipsis ('...') can only be used at the start of an indexing operation", )); } - Ok((Indexer::Elipsis, dims.len() - (index_argument_count - 1))) + Ok((Indexer::Ellipsis, dims.len() - (index_argument_count - 1))) } else if py_indexer.is_none() { // Handle None e.g. tensor[None, 0] Ok((Indexer::Expand, current_dim)) @@ -616,8 +616,9 @@ impl PyTensor { current_dim += 1; out } - Indexer::Elipsis => { - // Elipsis is a special case, it means that all remaining dimensions should be selected => advance the current_dim to the last dimension we have indexers for + Indexer::Ellipsis => { + // Ellipsis is a special case, it means that all remaining dimensions should be + // selected => advance the current_dim to the last dimension we have indexers for current_dim += dims.len() - (indexers.len() - 1); x } @@ -960,11 +961,11 @@ impl PyTensor { extraction_result: PyResult<T>, err_msg: &'static str, ) -> PyResult<()> { - if let Ok(sucessfull_extraction) = extraction_result { + if let Ok(successful_extraction) = extraction_result { if opt.is_some() { return Err(PyValueError::new_err(err_msg)); } - *opt = Some(sucessfull_extraction); + *opt = Some(successful_extraction); } Ok(()) } @@ -1045,9 +1046,7 @@ impl PyTensor { .map_err(wrap_err)?, (Some(device), None) => self.0.to_device(&device.as_device()?).map_err(wrap_err)?, (None, Some(dtype)) => self.0.to_dtype(dtype.0).map_err(wrap_err)?, - (None, None) => { - return Err(PyTypeError::new_err("No valide dtype or device specified")) - } + (None, None) => return Err(PyTypeError::new_err("No valid dtype or device specified")), }; Ok(PyTensor(result)) |