# `Snakepit.Error.DeviceMismatch`
[🔗](https://github.com/nshkrdotcom/snakepit/blob/v0.13.0/lib/snakepit/error/device.ex#L1)

Device mismatch error for tensor operations.

Raised when tensors on different devices are used in an operation
that requires them to be on the same device.

# `device`

```elixir
@type device() ::
  :cpu | :mps | {:cuda, non_neg_integer()} | {:rocm, non_neg_integer()}
```

# `t`

```elixir
@type t() :: %Snakepit.Error.DeviceMismatch{
  __exception__: true,
  expected: device() | nil,
  got: device() | nil,
  message: String.t(),
  operation: String.t() | nil
}
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
