burn-cubecl 0.22.0-pre.4

Generic backend that can be compiled just-in-time to any shader language target
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use crate::{ops::numeric::empty_device_dtype, tensor::CubeTensor};
use burn_backend::{DType, TensorMetadata, calculate_matmul_output};

/// Creates an empty output tensor with matmul output shape. The logical shapes: a storage-tiled
/// operand's physical dims are its tiles.
pub fn init_matmul_output(lhs: &CubeTensor, rhs: &CubeTensor, dtype: DType) -> CubeTensor {
    empty_device_dtype(
        lhs.client.clone(),
        lhs.device.clone(),
        calculate_matmul_output(&lhs.shape(), &rhs.shape()).unwrap(),
        dtype,
    )
}