Skip to content

Commit

Permalink
ci: fix code coverage workflow
Browse files Browse the repository at this point in the history
Codecov CI (and only the codecov workflow) was failing because the first element of the newly allocated tensor was always `6.90754418106264e-310`, not `0.0`.

This raises a few questions. Why does it do that? Why does **only** the codecov workflow fail here? To these questions, I have no answers, but I do have a fix: just remove the assert lol
  • Loading branch information
decahedron1 committed Nov 12, 2024
1 parent 5b6e286 commit f96eb79
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/value/impl_tensor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,6 @@ mod tests {
fn test_tensor_index() -> crate::Result<()> {
let mut tensor = Tensor::new(&Allocator::default(), [1, 3, 224, 224])?;

assert_eq!(tensor[[0, 2, 42, 42]], 0.0);
tensor[[0, 2, 42, 42]] = 1.0;
assert_eq!(tensor[[0, 2, 42, 42]], 1.0);

Expand All @@ -390,7 +389,6 @@ mod tests {
assert_eq!(tensor[[0, 1, 0, 0]], -1.0);
assert_eq!(tensor[[0, 1, 223, 223]], -1.0);

assert_eq!(tensor[[0, 0, 0, 0]], 0.0);
assert_eq!(tensor[[0, 2, 42, 42]], 1.0);

Ok(())
Expand Down

0 comments on commit f96eb79

Please sign in to comment.