Repository: pykeen/pykeen
Issue: InductiveERModel validation representations are on wrong device
Root cause: Resource Mishandling

### Describe the bug

The `NodePieceRepresentation`s which are not `"training"` remain on the CPU. This leads to errors when using `InductiveNodePiece`.

### How to reproduce

```python
from pykeen.datasets.inductive import ILPC2022Small
from pykeen.models import InductiveNodePiece


def main():
    ds = ILPC2022Small()
    inp = InductiveNodePiece(
        triples_factory=ds.transductive_training,
        inference_factory=ds.inductive_inference,
    )
    inp.to("cuda")

    training_device = (
        inp._get_entity_representations_from_inductive_mode(mode="training")[0]
        .base[0]
        .assignment.device
    )
    testing_device = (
        inp._get_entity_representations_from_inductive_mode(mode="testing")[0]
        .base[0]
        .assignment.device
    )
    print(f"training device={training_device}")
    print(f"testing device={testing_device}")
    print(
        inp._get_entity_representations_from_inductive_mode(mode="training")[0](
            indices=ds.transductive_training.mapped_triples[:, 0].to("cuda")
        ).shape
    )
    print(
        inp._get_entity_representations_from_inductive_mode(mode="testing")[0](
            indices=ds.inductive_inference.mapped_triples[:, 0].to("cuda")
        ).shape
    )


if __name__ == "__main__":
    main()

```

Leads to:
```
training device=cuda:0
testing device=cpu
torch.Size([78616, 64])
Traceback (most recent call last):
  File "/home/sc.uni-leipzig.de/se302qele/PyKEEN_EA/testinp.py", line 16, in <module>
    main()
  File "/home/sc.uni-leipzig.de/se302qele/PyKEEN_EA/testinp.py", line 12, in main
    print(inp._get_entity_representations_from_inductive_mode(mode="testing")[0](indices=ds.inductive_inference.mapped_triples[:, 0].to("cuda")).shape)
  File "/home/sc.uni-leipzig.de/se302qele/.cache/pypoetry/virtualenvs/pykeen-ea-B2xAgiv_-py3.9/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/sc.uni-leipzig.de/se302qele/.cache/pypoetry/virtualenvs/pykeen-ea-B2xAgiv_-py3.9/lib/python3.9/site-packages/pykeen/nn/representation.py", line 180, in forward
    x = self._plain_forward(indices=indices)
  File "/home/sc.uni-leipzig.de/se302qele/.cache/pypoetry/virtualenvs/pykeen-ea-B2xAgiv_-py3.9/lib/python3.9/site-packages/pykeen/nn/representation.py", line 1169, in _plain_forward
    return self.combine(combination=self.combination, base=self.base, indices=indices)
  File "/home/sc.uni-leipzig.de/se302qele/.cache/pypoetry/virtualenvs/pykeen-ea-B2xAgiv_-py3.9/lib/python3.9/site-packages/pykeen/nn/representation.py", line 1162, in combine
    return combination([b._plain_forward(indices=indices) for b in base])
  File "/home/sc.uni-leipzig.de/se302qele/.cache/pypoetry/virtualenvs/pykeen-ea-B2xAgiv_-py3.9/lib/python3.9/site-packages/pykeen/nn/representation.py", line 1162, in <listcomp>
    return combination([b._plain_forward(indices=indices) for b in base])
  File "/home/sc.uni-leipzig.de/se302qele/.cache/pypoetry/virtualenvs/pykeen-ea-B2xAgiv_-py3.9/lib/python3.9/site-packages/pykeen/nn/node_piece/representation.py", line 173, in _plain_forward
    token_ids = token_ids[indices]
RuntimeError: indices should be either on cpu or on the same device as the indexed tensor (cpu)
```

### Environment

| Key             | Value                        |
|-----------------|------------------------------|
| OS              | posix                        |
| Platform        | Linux                        |
| Release         | 4.18.0-372.26.1.el8_6.x86_64 |
| Time            | Wed Feb 15 09:04:25 2023     |
| Python          | 3.9.5                        |
| PyKEEN          | 1.10.1-dev                   |
| PyKEEN Hash     | 3d0166dc                     |
| PyKEEN Branch   | main                         |
| PyTorch         | 1.13.1+cu117                 |
| CUDA Available? | true                         |
| CUDA Version    | 11.7                         |
| cuDNN Version   | 8500                         |

### Additional information

_No response_

### Issue Template Checks

- [X] This is not a feature request (use a different issue template if it is)
- [X] This is not a question (use the [discussions](https://github.com/pykeen/pykeen/discussions/new) forum instead)
- [X] I've read the text explaining why including environment information is important and understand if I omit this information that my issue will be dismissed

Good catch, I think this problem is related to torch 1.13 as I see exactly the same indexing device error in other projects when run on torch 1.13. Surely, by the time of ILPC'22 release, everything trained fine on a GPU

Maybe it also came up with [these lines](https://github.com/pykeen/pykeen/blob/master/src/pykeen/models/inductive/base.py#L62-L90), that changed how the representations are coupled to the module and were probably introduced after ILPC'22.
Since there is also a note in the code hinting at this, I opted to address this bug somewhere else in the [PR](https://github.com/pykeen/pykeen/pull/1229), by either moving the representations when needed, or by overriding `.to`.

Closed by https://github.com/pykeen/pykeen/pull/1229