mirror of
https://github.com/zkonduit/ezkl.git
synced 2026-01-13 08:17:57 -05:00
Compare commits
2 Commits
ac/documen
...
ac/fix-sha
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fdc93b9572 | ||
|
|
f631445e26 |
@@ -1097,6 +1097,10 @@ fn _sort_ascending<F: PrimeField + TensorType + PartialOrd + std::hash::Hash>(
|
||||
let mut input = values[0].clone();
|
||||
input.flatten();
|
||||
|
||||
if input.len() == 1 {
|
||||
return Ok((input.clone(), create_zero_tensor(1)));
|
||||
}
|
||||
|
||||
let is_assigned = !input.any_unknowns()?;
|
||||
|
||||
// Generate sorted tensor - if values are assigned, compute the actual sort;
|
||||
|
||||
@@ -926,6 +926,9 @@ impl<T: Clone + TensorType> Tensor<T> {
|
||||
));
|
||||
}
|
||||
self.dims = vec![];
|
||||
}
|
||||
if self.dims() == &[0] && new_dims.iter().product::<usize>() == 1 {
|
||||
self.dims = Vec::from(new_dims);
|
||||
} else {
|
||||
let product = if new_dims != [0] {
|
||||
new_dims.iter().product::<usize>()
|
||||
@@ -1104,6 +1107,10 @@ impl<T: Clone + TensorType> Tensor<T> {
|
||||
let mut output = self.clone();
|
||||
output.reshape(shape)?;
|
||||
return Ok(output);
|
||||
} else if self.dims() == &[0] && shape.iter().product::<usize>() == 1 {
|
||||
let mut output = self.clone();
|
||||
output.reshape(shape)?;
|
||||
return Ok(output);
|
||||
}
|
||||
|
||||
if self.dims().len() > shape.len() {
|
||||
|
||||
Reference in New Issue
Block a user