From 77aecece6c5970ca68455d9ffc4a52b7d192f3b7 Mon Sep 17 00:00:00 2001 From: David Hagen Date: Thu, 16 Jul 2026 20:13:34 -0400 Subject: [PATCH 1/2] has_output in its various forms was removed as dead code --- .../identifiable_expression/_extract_context.py | 3 --- src/tensora/iteration_graph/iteration_graph.py | 14 -------------- 2 files changed, 17 deletions(-) diff --git a/src/tensora/iteration_graph/identifiable_expression/_extract_context.py b/src/tensora/iteration_graph/identifiable_expression/_extract_context.py index 315984d..9d044d7 100644 --- a/src/tensora/iteration_graph/identifiable_expression/_extract_context.py +++ b/src/tensora/iteration_graph/identifiable_expression/_extract_context.py @@ -16,7 +16,6 @@ class Context: sparse_leaves: list[TensorLayer] = field(default_factory=list) dense_leaves: list[TensorLayer] = field(default_factory=list) indexes: frozenset[str] = frozenset() - has_output: bool = False has_assemble: bool = False def add(self, other: Context) -> Context: @@ -25,7 +24,6 @@ def add(self, other: Context) -> Context: sparse_leaves=self.sparse_leaves + other.sparse_leaves, dense_leaves=self.dense_leaves + other.dense_leaves, indexes=self.indexes | other.indexes, - has_output=self.has_output or other.has_output, has_assemble=self.has_assemble or other.has_assemble, ) @@ -35,7 +33,6 @@ def multiply(self, other: Context) -> Context: sparse_leaves=self.sparse_leaves + other.sparse_leaves, dense_leaves=self.dense_leaves + other.dense_leaves, indexes=self.indexes | other.indexes, - has_output=self.has_output or other.has_output, has_assemble=self.has_assemble or other.has_assemble, ) diff --git a/src/tensora/iteration_graph/iteration_graph.py b/src/tensora/iteration_graph/iteration_graph.py index 23c9a50..fd3a084 100644 --- a/src/tensora/iteration_graph/iteration_graph.py +++ b/src/tensora/iteration_graph/iteration_graph.py @@ -34,10 +34,6 @@ def compressed_dimensions(self) -> StableFrozenSet[str]: def later_indexes(self) -> frozenset[str]: raise NotImplementedError() - @abstractmethod - def has_output(self) -> bool: - raise NotImplementedError() - @dataclass(frozen=True) class TerminalNode(IterationGraph): @@ -59,9 +55,6 @@ def compressed_dimensions(self) -> StableFrozenSet[str]: def later_indexes(self) -> frozenset[str]: return frozenset() - def has_output(self) -> bool: - return False - @dataclass(frozen=True) class IterationNode(IterationGraph): @@ -78,7 +71,6 @@ def extract_context(self, index: str) -> Context: return replace( next_context, indexes=next_context.indexes | frozenset([self.index_variable]), - has_output=next_context.has_output or self.output is not None, has_assemble=next_context.has_assemble or self.is_sparse_output(), ) @@ -108,9 +100,6 @@ def is_sparse_output(self) -> bool: def later_indexes(self) -> frozenset[str]: return self.context.indexes - def has_output(self) -> bool: - return self.context.has_output - def has_assemble(self) -> bool: return self.context.has_assemble @@ -149,6 +138,3 @@ def compressed_dimensions(self) -> StableFrozenSet[str]: def later_indexes(self) -> frozenset[str]: return frozenset.union(*(term.later_indexes() for term in self.terms)) - - def has_output(self) -> bool: - return any(term.has_output() for term in self.terms) From 94208c3df26c54b13135759e3c71f6112db5664a Mon Sep 17 00:00:00 2001 From: David Hagen Date: Thu, 16 Jul 2026 20:40:22 -0400 Subject: [PATCH 2/2] Remove is_dense_output as dead code --- src/tensora/iteration_graph/iteration_graph.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/tensora/iteration_graph/iteration_graph.py b/src/tensora/iteration_graph/iteration_graph.py index fd3a084..c9c022d 100644 --- a/src/tensora/iteration_graph/iteration_graph.py +++ b/src/tensora/iteration_graph/iteration_graph.py @@ -91,9 +91,6 @@ def dense_leaves(self) -> list[TensorLayer]: def is_sparse_input(self) -> bool: return self.context.is_sparse - def is_dense_output(self) -> bool: - return self.output is not None and self.output.mode == Mode.dense - def is_sparse_output(self) -> bool: return self.output is not None and self.output.mode == Mode.compressed