Repository: pytorch
Issue: [JIT][tensorexpr] cat, batch_norm opinfo tests failing
Labels: oncall: jit,NNC

### 🐛 Describe the bug

cat and batch_norm fail in the opinfo tests for NNC

batchnorm issue occurs when all tensors are empty

repro:
```python
import torch

torch._C._jit_set_profiling_executor(True)
torch._C._jit_set_profiling_mode(True)

torch._C._jit_override_can_fuse_on_cpu(True)
torch._C._jit_override_can_fuse_on_gpu(True)
torch._C._jit_set_texpr_fuser_enabled(True)
torch._C._debug_set_fusion_group_inlining(False)
torch._C._jit_set_te_must_use_llvm_cpu(False)

def bn(inp, running_mean, running_var):
    return torch.nn.functional.batch_norm(inp, running_mean, running_var, None, None)

inp = torch.tensor([], dtype=torch.float32)
running_mean = torch.tensor([], dtype=torch.float32)
running_var = torch.tensor([], dtype=torch.float32)

tensors = [inp, running_mean, running_var]

trace = torch.jit.trace(bn, tensors)

bn(inp, running_mean, running_var)
trace(inp, running_mean, running_var)
```

cat issue is that the device type cannot be obtained:

```
(pytorch) [dberard@devvm928.vll0 ~/local/pytorch] PYTORCH_JIT_LOG_LEVEL=">>kernel.cpp" python3 test/test_jit_fuser_te.py -k test_nnc_correctness_cat_cpu_float32
CUDA not available, skipping tests
monkeytype is not installed. Skipping tests for Profile-Directed Typing
[DUMP kernel.cpp:1272] TensorExprKernel graph:
[DUMP kernel.cpp:1272] graph(%0 : Tensor[]):
[DUMP kernel.cpp:1272]   %1 : int = prim::Constant[value=-1]()
[DUMP kernel.cpp:1272]   %2 : Float(5, 10, strides=[10, 1], requires_grad=0, device=cpu) = aten::cat(%0, %1) # /home/dberard/local/miniconda3/envs/pytorch/lib/python3.9/site-packag
es/torch/testing/_internal/jit_metaprogramming_utils.py:354:0
[DUMP kernel.cpp:1272]   return (%2)
E
======================================================================
ERROR: test_nnc_correctness_cat_cpu_float32 (__main__.TestNNCOpInfoCPU)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/dberard/local/miniconda3/envs/pytorch/lib/python3.9/site-packages/torch/jit/_fuser.py", line 81, in _script_method_graph_for
    dbs = parent.get_debug_state()
RuntimeError: optimized_plan_INTERNAL ASSERT FAILED at "../torch/csrc/jit/runtime/profiling_graph_executor_impl.cpp":625, please report a bug to PyTorch.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/dberard/local/miniconda3/envs/pytorch/lib/python3.9/site-packages/torch/testing/_internal/common_device_type.py", line 381, in instantiated_test
    raise rte
  File "/home/dberard/local/miniconda3/envs/pytorch/lib/python3.9/site-packages/torch/testing/_internal/common_device_type.py", line 376, in instantiated_test
    result = test(self, **param_kwargs)
  File "/home/dberard/local/miniconda3/envs/pytorch/lib/python3.9/site-packages/torch/testing/_internal/common_device_type.py", line 753, in test_wrapper
    return test(*args, **kwargs)
  File "/home/dberard/local/miniconda3/envs/pytorch/lib/python3.9/site-packages/torch/testing/_internal/common_device_type.py", line 907, in only_fn
    return fn(slf, *args, **kwargs)
  File "/data/users/dberard/pytorch/test/test_jit_fuser_te.py", line 2202, in test_nnc_correctness
    trace(*clone_inputs((sample.input, *sample.args)), **sample.kwargs)
  File "/home/dberard/local/miniconda3/envs/pytorch/lib/python3.9/site-packages/torch/testing/_internal/jit_metaprogramming_utils.py", line 369, in traced_fn
    traced_fn.last_graph = traced.graph_for(*inputs_tensors)  # type: ignore[attr-defined]
  File "/home/dberard/local/miniconda3/envs/pytorch/lib/python3.9/site-packages/torch/jit/_fuser.py", line 77, in _graph_for
    return _script_method_graph_for(self, self, *args, **kwargs)
  File "/home/dberard/local/miniconda3/envs/pytorch/lib/python3.9/site-packages/torch/jit/_fuser.py", line 106, in _script_method_graph_for
    self(*args, **kwargs)
  File "/home/dberard/local/miniconda3/envs/pytorch/lib/python3.9/site-packages/torch/testing/_internal/common_utils.py", line 418, in prof_func_call
    return prof_callable(func_call, *args, **kwargs)
  File "/home/dberard/local/miniconda3/envs/pytorch/lib/python3.9/site-packages/torch/testing/_internal/common_utils.py", line 415, in prof_callable
    return callable(*args, **kwargs)
RuntimeError: deviceINTERNAL ASSERT FAILED at "../torch/csrc/jit/tensorexpr/kernel.cpp":171, please report a bug to PyTorch. Could not find device in fuser graph inputs. This error
 occured in the fuser. You can turn off the fuser with torch.jit.enable_fusion(False).

----------------------------------------------------------------------
Ran 1 test in 0.159s

FAILED (errors=1)
```

### Versions

viable/strict