Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for recursive datatypes #866

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
pip3 install --pre torch -f "${{ steps.pytorch_channel.outputs.value }}"
- name: Install dependencies
run: |
pip3 install requests mypy==0.812 graphviz numpy
pip3 install requests mypy==0.981 graphviz numpy
abhi-glitchhg marked this conversation as resolved.
Show resolved Hide resolved
- name: Build TorchData
run: |
python setup.py develop
Expand Down
2 changes: 1 addition & 1 deletion torchdata/datapipes/iter/util/tfrecordloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def prod(xs):
# Note, reccursive types not supported by mypy at the moment
# TODO(640): uncomment as soon as it becomes supported
# https://github.com/python/mypy/issues/731
# BinaryData = Union[str, List['BinaryData']]
BinaryData = Union[str, List['BinaryData']]
TFRecordBinaryData = Union[str, List[str], List[List[str]], List[List[List[Any]]]]
TFRecordExampleFeature = Union[torch.Tensor, List[torch.Tensor], TFRecordBinaryData]
TFRecordExample = Dict[str, TFRecordExampleFeature]
Expand Down