Skip to content

Commit

Permalink
Simplify default configuration for pz.de.TellIntermediate.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 625558643
  • Loading branch information
danieldjohnson authored and Penzai Developers committed Apr 17, 2024
1 parent ed92dd0 commit 2b4a40a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
# Install deps
- uses: actions/setup-python@v4
with:
python-version: 3.10
python-version: 3.10.14
# Uncomment to cache of pip dependencies (if tests too slow)
# cache: pip
# cache-dependency-path: '**/pyproject.toml'
Expand Down
4 changes: 2 additions & 2 deletions penzai/data_effects/side_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,13 @@ def _make_ref(hole: SideOutputRequest):
class TellIntermediate(layer_base.Layer):
"""Helper layer that writes its intermediate value to a side output."""

side_out: SideOutputEffect
side_out: SideOutputEffect = SideOutputRequest(tag="intermediate")

def __call__(self, intermediate_value):
self.side_out.tell(intermediate_value)
return intermediate_value

@classmethod
def from_config(cls, tag: SideOutputTag = "intermediate") -> TellIntermediate:
def from_config(cls, tag: SideOutputTag) -> TellIntermediate:
"""Builds a TellIntermediate layer that writes to the given tag."""
return cls(side_out=SideOutputRequest(tag=tag))

0 comments on commit 2b4a40a

Please sign in to comment.