Skip to main content

easy_wgpu/
error.rs

1#[cfg(feature = "burn-torch")]
2#[derive(Debug, thiserror::Error)]
3pub enum CudaInteropError {
4    #[error("Tensor must be 4D (N,C,H,W), but got {0} dimensions")]
5    InvalidTensorDim(usize),
6    #[error("Provided tensor has to be have only one batch but it has first dim as {0}")]
7    InvalidBatchSize(usize),
8    #[error("Nr channels has to be 4 or less but it has {0} channels")]
9    InvalidChannelSize(usize),
10    #[error("Interop not allowed for tensor of type {0:?}")]
11    InvalidTensorType(tch::Kind),
12    #[error("Tensor has to be contiguous in memory")]
13    InvalidNonContiguous,
14}