I am trying to run the following code
import torch

@torch.jit.script
def foo(x: torch.Tensor, y: bool):
    return x & y

print(foo.graph)

But ran into an error
RuntimeError:
Arguments for call are not valid.
The following variants are available:

  aten::__and__.Scalar(Tensor self, Scalar other) -> (Tensor):
  Expected a value of type 'number' for argument 'other' but instead found type 'bool'.

  aten::__and__.Tensor(Tensor self, Tensor other) -> (Tensor):
  Expected a value of type 'Tensor' for argument 'other' but instead found type 'bool'.

  aten::__and__.bool(bool a, bool b) -> (bool):
  Expected a value of type 'bool' for argument 'a' but instead found type 'Tensor'.

  aten::__and__.int(int a, int b) -> (int):
  Expected a value of type 'int' for argument 'b' but instead found type 'bool'.

The original call is:
  File "bool_torchscript.py", line 5
@torch.jit.script
def foo(x: torch.Tensor, y: bool):
    return x & y
           ~~~~~ <--- HERE

Does this mean that scalar cannot be of bool type and has to be int/float only?