# [Numpy-discussion] Tensor Typing presentation and discussion on Wednesday! (As part of the NumPy Community Meeting)

Tue Jun 15 05:16:36 EDT 2021

```Hi Juan

Thanks for the kind words!

why isn’t there a Subtract operator?
>

I *think* this is just because the implementation in Pyre is still an early
prototype. Alfonso?

is there a prospect for using actual operators and actual literals here?
>

That's a really good question. We're optimistic that actual literals should
be possible - we assumed there was some subtle reason we'd have to use
Literal, but when we briefly talked about it at PyCon, Guido was like
"Nope, you should just write a PEP for that". As for actual operators - I
can't think of any *technical* reason this shouldn't be possible - when it
comes time to write a PEP for type arithmetic it's definitely something we
should propose. Alfonso, any thoughts?

Best,
Matthew

On Mon, 14 Jun 2021 at 03:51, Juan Nunez-Iglesias <jni at fastmail.com> wrote:

> Thank you so much Matthew, Pradeep, and everyone else helping with this
> effort!
>
> And thanks Matthew for sharing the slides — very informative! I’ve asked
> Sebastian for the recording but in the meantime I thought I’d ask a couple
> of questions about the syntax:
>
> * why isn’t there a Subtract operator? It seems that Subtract[A, B] is
> * is there a prospect for using actual operators and actual literals here?
> I think that a lot of reticence about Python typing comes from the
> annotations being so difficult to read. There’s been some great
> improvements recently with “Optional[Tuple[Union[Float, Int]]]” becoming
> “tuple[float | int] | None”, and I hope we can leapfrog the awkward phase
> with this tensor typing stuff. Again, A - B is much more readable again
> than Subtract[A, B]. And B-2 is much more readable than Add[B, Literal[-2]].
>
> Other than that, love the work, thank you again!
>
> Juan.
>
> On 11 Jun 2021, at 5:08 am, Matthew Rahtz <mrahtz at google.com> wrote:
>
> Some links I promised to send around:
>
>    - https://github.com/deepmind/tensor_annotations which has a bunch of
>    experimental shape-aware stubs for TensorFlow and JAX using 'semantic' axis
>    labels
>    - https://github.com/pradeep90/pytorch_examples ditto for TensorFlow
>    and PyTorch using value-based axis labels
>    - https://arxiv.org/pdf/2102.13254.pdf Similar work in TensorFlow for
>    Swift
>    - Slides
>    our presentation
>    - Tensor typing meeting details
>
> Thanks again, everyone!
>
> On Wed, 9 Jun 2021 at 22:28, Sebastian Berg <sebastian at sipsolutions.net>
> wrote:
>
>> On Tue, 2021-06-08 at 11:40 -0700, Stefan van der Walt wrote:
>> > On Tue, Jun 8, 2021, at 03:23, Juan Nunez-Iglesias wrote:
>> > > Hello! Any chance this could be recorded for those of us in useless
>> > > time zones? 😂
>> >
>> > I added a note to the agenda; we'll ask the speakers and record if
>> > they don't mind.
>>
>>
>> We have made a recording, but I did not plan on making it available
>>
>> Cheers,
>>
>> Sebastian
>>
>>
>> > Stéfan
>> > _______________________________________________
>> > NumPy-Discussion mailing list
>> > NumPy-Discussion at python.org
>> > https://mail.python.org/mailman/listinfo/numpy-discussion
>>
>>
>> _______________________________________________
>> NumPy-Discussion mailing list
>> NumPy-Discussion at python.org
>> https://mail.python.org/mailman/listinfo/numpy-discussion
>>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at python.org
> https://mail.python.org/mailman/listinfo/numpy-discussion
>
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at python.org
> https://mail.python.org/mailman/listinfo/numpy-discussion
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/pipermail/numpy-discussion/attachments/20210615/860a89d8/attachment-0001.html>
```