@@ -85,20 +85,20 @@ fn texture_desc_from_tensor(
85
85
match tensor. dtype ( ) {
86
86
TensorDataType :: U8 => {
87
87
let tensor = ndarray:: ArrayViewD :: < u8 > :: try_from ( tensor) ?;
88
- texture_desc_from_tensor_slice ( & tensor, slice_selection, TextureFormat :: R8Uint , |x| x)
88
+ to_texture_desc ( & tensor, slice_selection, TextureFormat :: R8Uint , |x| x)
89
89
}
90
90
TensorDataType :: U16 => {
91
91
let tensor = ndarray:: ArrayViewD :: < u16 > :: try_from ( tensor) ?;
92
- texture_desc_from_tensor_slice ( & tensor, slice_selection, TextureFormat :: R16Uint , |x| x)
92
+ to_texture_desc ( & tensor, slice_selection, TextureFormat :: R16Uint , |x| x)
93
93
}
94
94
TensorDataType :: U32 => {
95
95
let tensor = ndarray:: ArrayViewD :: < u32 > :: try_from ( tensor) ?;
96
- texture_desc_from_tensor_slice ( & tensor, slice_selection, TextureFormat :: R32Uint , |x| x)
96
+ to_texture_desc ( & tensor, slice_selection, TextureFormat :: R32Uint , |x| x)
97
97
}
98
98
TensorDataType :: U64 => {
99
99
// narrow to f32:
100
100
let tensor = ndarray:: ArrayViewD :: < u64 > :: try_from ( tensor) ?;
101
- texture_desc_from_tensor_slice (
101
+ to_texture_desc (
102
102
& tensor,
103
103
slice_selection,
104
104
TextureFormat :: R32Float ,
@@ -107,20 +107,20 @@ fn texture_desc_from_tensor(
107
107
}
108
108
TensorDataType :: I8 => {
109
109
let tensor = ndarray:: ArrayViewD :: < i8 > :: try_from ( tensor) ?;
110
- texture_desc_from_tensor_slice ( & tensor, slice_selection, TextureFormat :: R8Sint , |x| x)
110
+ to_texture_desc ( & tensor, slice_selection, TextureFormat :: R8Sint , |x| x)
111
111
}
112
112
TensorDataType :: I16 => {
113
113
let tensor = ndarray:: ArrayViewD :: < i16 > :: try_from ( tensor) ?;
114
- texture_desc_from_tensor_slice ( & tensor, slice_selection, TextureFormat :: R16Sint , |x| x)
114
+ to_texture_desc ( & tensor, slice_selection, TextureFormat :: R16Sint , |x| x)
115
115
}
116
116
TensorDataType :: I32 => {
117
117
let tensor = ndarray:: ArrayViewD :: < i32 > :: try_from ( tensor) ?;
118
- texture_desc_from_tensor_slice ( & tensor, slice_selection, TextureFormat :: R32Sint , |x| x)
118
+ to_texture_desc ( & tensor, slice_selection, TextureFormat :: R32Sint , |x| x)
119
119
}
120
120
TensorDataType :: I64 => {
121
121
// narrow to f32:
122
122
let tensor = ndarray:: ArrayViewD :: < i64 > :: try_from ( tensor) ?;
123
- texture_desc_from_tensor_slice (
123
+ to_texture_desc (
124
124
& tensor,
125
125
slice_selection,
126
126
TextureFormat :: R32Float ,
@@ -129,16 +129,16 @@ fn texture_desc_from_tensor(
129
129
}
130
130
TensorDataType :: F16 => {
131
131
let tensor = ndarray:: ArrayViewD :: < half:: f16 > :: try_from ( tensor) ?;
132
- texture_desc_from_tensor_slice ( & tensor, slice_selection, TextureFormat :: R16Float , |x| x)
132
+ to_texture_desc ( & tensor, slice_selection, TextureFormat :: R16Float , |x| x)
133
133
}
134
134
TensorDataType :: F32 => {
135
135
let tensor = ndarray:: ArrayViewD :: < f32 > :: try_from ( tensor) ?;
136
- texture_desc_from_tensor_slice ( & tensor, slice_selection, TextureFormat :: R32Float , |x| x)
136
+ to_texture_desc ( & tensor, slice_selection, TextureFormat :: R32Float , |x| x)
137
137
}
138
138
TensorDataType :: F64 => {
139
139
// narrow to f32:
140
140
let tensor = ndarray:: ArrayViewD :: < f64 > :: try_from ( tensor) ?;
141
- texture_desc_from_tensor_slice (
141
+ to_texture_desc (
142
142
& tensor,
143
143
slice_selection,
144
144
TextureFormat :: R32Float ,
@@ -148,7 +148,7 @@ fn texture_desc_from_tensor(
148
148
}
149
149
}
150
150
151
- fn texture_desc_from_tensor_slice < From : Copy , To : bytemuck:: Pod > (
151
+ fn to_texture_desc < From : Copy , To : bytemuck:: Pod > (
152
152
tensor : & ndarray:: ArrayViewD < ' _ , From > ,
153
153
slice_selection : & SliceSelection ,
154
154
format : wgpu:: TextureFormat ,
0 commit comments