# Jit does not support doesn't support binary operator

**URL:** <https://discuss.pytorch.org/t/jit-does-not-support-doesnt-support-binary-operator/69881>\
**Category:** jit\
**Created:** [February 16, 2020, 4:12am UTC](https://discuss.pytorch.org/t/jit-does-not-support-doesnt-support-binary-operator/69881 "2020-02-16T04:12:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![G.M](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/g.m/32/19266_2.png) [@G.M](https://discuss.pytorch.org/u/G.M)\
**Post date:** [February 16, 2020, 4:12am UTC](https://discuss.pytorch.org/t/jit-does-not-support-doesnt-support-binary-operator/69881/1 "2020-02-16T04:12:04Z")

</div>

I have a code that looks like this

```auto
import torch as tc
from torch import jit
@jit.script
def func(inp):
    return inp<<1
a = tc.tensor([3,4,5])
func(a)

```

when I run it, I got the error:

```auto
torch.jit.frontend.NotSupportedError: unsupported binary operator: LShift:
  File "example.py", line 5
@jit.script
def func(inp):
    return inp<<1
              ~~ <--- HERE

```

However, if I change `inp<<1` to `inp. __lshift__ (1)`, it works. This also happens in C++. Is there a reason behind this or is it just that support for binary operators are not fully implemented yet? I’m using Pytorch 1.4.0 on windows with the corresponding version of libtorch.  
Thanks.

---

<div class="post-metadata">

**Author:** ![driazati](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/driazati/32/15393_2.png) [@driazati](https://discuss.pytorch.org/u/driazati)\
**Post date:** [February 18, 2020, 6:42pm UTC](https://discuss.pytorch.org/t/jit-does-not-support-doesnt-support-binary-operator/69881/2 "2020-02-18T18:42:25Z")

</div>

Looks like this was just an oversight, can you [file a bug](https://github.com/pytorch/pytorch/issues/new/choose) with this info so we can have it in our issue tracker? (We’re happy to accept any PRs to add it too!)
