Crates.io | tensor_compute |
lib.rs | tensor_compute |
version | 0.1.0 |
source | src |
created_at | 2020-08-19 02:27:59.446818 |
updated_at | 2020-08-19 02:27:59.446818 |
description | A Tensor computing library for Rust |
homepage | |
repository | https://github.com/tiberiusferreira/gpu_compute |
max_upload_size | |
id | 278093 |
size | 8,495,144 |
This is a personal project to teach myself WebGPU computing, focused
on Machine Learning application.
Element Wise Tensor - Tensor Ops:
Scalar - Tensor Ops:
Working Example:
fn main() {
println!("Running in {:?}", GpuStore::get_default().info());
let ma = Tensor::from_data_and_shape(vec![1., 2., 3., 4., 5., 6., 7., 8.], vec![2, 2, 2]);
let mb = Tensor::from_data_and_shape(vec![2., 3., 4., 5.], vec![2, 2]);
let result = ma.matmul(&mb);
println!("{:?}", result);
/*
Running in AdapterInfo { name: "AMD Radeon Pro 560", vendor: 0, device: 0, device_type: DiscreteGpu, backend: Metal }
Shape: [2, 2, 2]
[[[ 10 13 ]
[ 22 29 ]]
[[ 34 45 ]
[ 46 61 ]]]
*/
}