Skip to content

Commit

Permalink
Shapetracker hack
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe Fioti authored and Joe Fioti committed Jan 9, 2024
1 parent e1cf44a commit 7a9f9e0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/core/shape/tracker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ impl ShapeTracker {
}

pub fn index_expression(&self) -> BigExpression {
if self.is_contiguous() && !self.is_sliced() && !self.is_padded() {
return 'z'.into();
}
// Create strides in original order
let mut strides = self
.dims
Expand Down Expand Up @@ -147,6 +150,9 @@ impl ShapeTracker {

/// If this BigExpression evaluates to 0, the logical index is invalid. Otherwise it is valid
pub fn valid_expression(&self) -> BigExpression {
if self.is_contiguous() && !self.is_sliced() && !self.is_padded() {
return 1.into();
}
let mut ret = BigExpression::from(1);
let mut acc = BigExpression::from(1);
let logical = BigExpression::from('z');
Expand Down

0 comments on commit 7a9f9e0

Please sign in to comment.