awkward icon indicating copy to clipboard operation
awkward copied to clipboard

feat: to/from PyTorch JaggedTensor

Open maxymnaumchyk opened this issue 1 year ago • 4 comments

maxymnaumchyk avatar Sep 17 '24 21:09 maxymnaumchyk

Codecov Report

Attention: Patch coverage is 23.25581% with 66 lines in your changes missing coverage. Please review.

Project coverage is 81.85%. Comparing base (b749e49) to head (c68321c). Report is 182 commits behind head on main.

Files with missing lines Patch % Lines
src/awkward/operations/ak_to_jaggedtensor.py 20.00% 40 Missing :warning:
src/awkward/operations/ak_from_jaggedtensor.py 23.52% 26 Missing :warning:
Additional details and impacted files
Files with missing lines Coverage Δ
src/awkward/operations/__init__.py 100.00% <100.00%> (ø)
src/awkward/operations/ak_from_jaggedtensor.py 23.52% <23.52%> (ø)
src/awkward/operations/ak_to_jaggedtensor.py 20.00% <20.00%> (ø)

... and 105 files with indirect coverage changes

codecov[bot] avatar Sep 17 '24 21:09 codecov[bot]

@jpivarski should I also leave out a "keep_regular" parameter since it does the same as ak.from_regular()? It's kind of the same situation we talked about today (about "padded" parameter).

maxymnaumchyk avatar Sep 18 '24 17:09 maxymnaumchyk

You're right: it is. The situation is that we should be providing an interface to the user that's like Lego bricks that they can put together however they like. If there's an alternative way of doing something, it shouldn't be a feature of the new functions, because then we'd have to explain why someone would use one or the other.

I agree that the padded and keep_regular arguments are more convenient if that's exactly what someone wants; passing padded=True or keep_regular=True is easier than the multi-step process it would be with the other method. However, these shortcuts would only work in the cases that these functions apply to, which are limited by the capabilities of TensorFlow and PyTorch's ragged array implementations.

jpivarski avatar Sep 18 '24 17:09 jpivarski

thanks for such a detailed answer!

maxymnaumchyk avatar Sep 18 '24 18:09 maxymnaumchyk

I think this one was closed in favor of another. This was the implementation that converted to and from a data type that users of PyTorch are not familiar with.

jpivarski avatar Nov 07 '24 16:11 jpivarski