1use crate::DataType;
2
3pub mod data_type;
4pub mod device;
5mod from_image;
6
7#[derive(Debug, Default)]
8pub struct Tensor {
9 kind: DataType,
10}
11impl Tensor {
12 pub fn get_type(&self) -> DataType {
14 self.kind
15 }
16 pub unsafe fn set_type(&mut self, kind: DataType) {
30 self.kind = kind;
31 }
32 pub fn cast_type(&mut self, kind: DataType) {
33 self.kind = kind;
34 }
35 pub fn with_type(mut self, kind: DataType) -> Self {
36 self.cast_type(kind);
37 self
38 }
39 pub fn get_bytes(&self) -> &[u8] {
40 todo!()
41 }
42 pub unsafe fn set_bytes(&mut self, bytes: &[u8]) {
43 todo!()
44 }
45 pub fn with_bytes(mut self, bytes: &[u8]) -> Self {
46 unsafe { self.set_bytes(bytes) };
47 self
48 }
49}