Skip to content

Commit

Permalink
fix Eq on TValue
Browse files Browse the repository at this point in the history
  • Loading branch information
kali committed Sep 5, 2023
1 parent c6a8d78 commit 889f82e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion core/src/value.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
use crate::internal::*;
use std::ops::Deref;
use std::rc::Rc;

use tract_ndarray::Array;
use TValue::*;

#[derive(Clone, PartialEq, Eq)]
#[derive(Clone, Eq)]
pub enum TValue {
Const(Arc<Tensor>),
Var(Rc<Tensor>),
Expand All @@ -16,6 +17,12 @@ impl std::fmt::Debug for TValue {
}
}

impl PartialEq for TValue {
fn eq(&self, other: &Self) -> bool {
self.deref() == other.deref()
}
}

impl TValue {
pub fn is_exclusive(&self) -> bool {
match self {
Expand Down

0 comments on commit 889f82e

Please sign in to comment.