diff --git a/pyqtorch/composite/sequence.py b/pyqtorch/composite/sequence.py index 02bda51e..8e2c0233 100644 --- a/pyqtorch/composite/sequence.py +++ b/pyqtorch/composite/sequence.py @@ -94,7 +94,11 @@ def __len__(self) -> int: return len(self.operations) def __hash__(self) -> int: - return hash(reduce(add, (hash(op) for op in self.operations))) + return hash( + reduce(add, (hash(op) for op in self.operations)) + if len(self.operations) > 0 + else self.operations + ) def forward( self,