pub type TensorGpu<T, K> = Tensor<Gpu<K>, T>;Aliased Type§
pub struct TensorGpu<T, K> { /* private fields */ }Implementations§
Source§impl<T: Scalar, K: Kind> TensorGpu<T, K>
impl<T: Scalar, K: Kind> TensorGpu<T, K>
pub fn from_data_u8( context: &Context, shape: impl Into<Shape>, contents: &[u8], ) -> Result<Self, TensorError>
pub fn back_in_place(&self) -> TensorCpu<T>
pub async fn back(&self) -> TensorCpu<T>
Source§impl<T: Scalar> TensorGpu<T, Uniform>
impl<T: Scalar> TensorGpu<T, Uniform>
pub fn layout(&self, binding: u32) -> BindGroupLayoutEntry
Source§impl<T: Scalar> TensorGpu<T, ReadWrite>
impl<T: Scalar> TensorGpu<T, ReadWrite>
pub fn meta_layout(&self, binding: u32) -> BindGroupLayoutEntry
pub fn layout(&self, binding: u32, read_only: bool) -> BindGroupLayoutEntry
Source§impl<T: Scalar> TensorGpu<T, ReadWrite>
impl<T: Scalar> TensorGpu<T, ReadWrite>
Sourcepub fn view(
&self,
x: impl TensorAxis,
y: impl TensorAxis,
z: impl TensorAxis,
w: impl TensorAxis,
) -> Result<TensorGpuView<'_, T>, TensorError>
pub fn view( &self, x: impl TensorAxis, y: impl TensorAxis, z: impl TensorAxis, w: impl TensorAxis, ) -> Result<TensorGpuView<'_, T>, TensorError>
Create a view for the tensor.
Trait Implementations§
Source§impl<T: Scalar + Serialize, K: Kind> Serialize for TensorGpu<T, K>
Available on non-WebAssembly only.
impl<T: Scalar + Serialize, K: Kind> Serialize for TensorGpu<T, K>
Available on non-WebAssembly only.
Source§impl<T: Scalar> TensorInto<Tensor<Gpu<ReadWrite>, T>> for TensorGpu<T, ReadWrite>
Available on non-WebAssembly only.
impl<T: Scalar> TensorInto<Tensor<Gpu<ReadWrite>, T>> for TensorGpu<T, ReadWrite>
Available on non-WebAssembly only.
Source§impl<T: Scalar, K: Kind> TensorReshape for TensorGpu<T, K>
impl<T: Scalar, K: Kind> TensorReshape for TensorGpu<T, K>
fn reshape( &self, x: TensorDimension, y: TensorDimension, z: TensorDimension, w: TensorDimension, ) -> Result<Self, TensorError>
Source§impl<T: Scalar, K: Kind> TensorResource for TensorGpu<T, K>
impl<T: Scalar, K: Kind> TensorResource for TensorGpu<T, K>
Source§fn resource_key(&self) -> ResourceKey
fn resource_key(&self) -> ResourceKey
Retrieve the key identifying a resource.
Source§fn meta_binding(&self) -> BindingResource<'_>
fn meta_binding(&self) -> BindingResource<'_>
Binding for metadata of the tensor (shape, stride, etc.).
Source§fn binding(&self) -> BindingResource<'_>
fn binding(&self) -> BindingResource<'_>
Binding for actual data of the tensor.
Source§impl<T: Scalar, K: Kind> TensorShape for TensorGpu<T, K>
impl<T: Scalar, K: Kind> TensorShape for TensorGpu<T, K>
Source§fn check_shape(&self, shape: impl Into<Shape>) -> Result<(), TensorError>
fn check_shape(&self, shape: impl Into<Shape>) -> Result<(), TensorError>
Check if the tensor’s shape is the same as what expected.
Source§fn check_shape_any<S>(&self, shapes: &[S]) -> Result<(), TensorError>
fn check_shape_any<S>(&self, shapes: &[S]) -> Result<(), TensorError>
Check if the tensor’s shape matches any of the expected ones.