Skip to content

Commit 9058f62

Browse files
committed
Shorten function name
1 parent 42a4add commit 9058f62

File tree

1 file changed

+12
-12
lines changed
  • crates/re_viewer/src/ui/view_tensor

1 file changed

+12
-12
lines changed

crates/re_viewer/src/ui/view_tensor/gpu.rs

+12-12
Original file line numberDiff line numberDiff line change
@@ -85,20 +85,20 @@ fn texture_desc_from_tensor(
8585
match tensor.dtype() {
8686
TensorDataType::U8 => {
8787
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)
8989
}
9090
TensorDataType::U16 => {
9191
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)
9393
}
9494
TensorDataType::U32 => {
9595
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)
9797
}
9898
TensorDataType::U64 => {
9999
// narrow to f32:
100100
let tensor = ndarray::ArrayViewD::<u64>::try_from(tensor)?;
101-
texture_desc_from_tensor_slice(
101+
to_texture_desc(
102102
&tensor,
103103
slice_selection,
104104
TextureFormat::R32Float,
@@ -107,20 +107,20 @@ fn texture_desc_from_tensor(
107107
}
108108
TensorDataType::I8 => {
109109
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)
111111
}
112112
TensorDataType::I16 => {
113113
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)
115115
}
116116
TensorDataType::I32 => {
117117
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)
119119
}
120120
TensorDataType::I64 => {
121121
// narrow to f32:
122122
let tensor = ndarray::ArrayViewD::<i64>::try_from(tensor)?;
123-
texture_desc_from_tensor_slice(
123+
to_texture_desc(
124124
&tensor,
125125
slice_selection,
126126
TextureFormat::R32Float,
@@ -129,16 +129,16 @@ fn texture_desc_from_tensor(
129129
}
130130
TensorDataType::F16 => {
131131
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)
133133
}
134134
TensorDataType::F32 => {
135135
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)
137137
}
138138
TensorDataType::F64 => {
139139
// narrow to f32:
140140
let tensor = ndarray::ArrayViewD::<f64>::try_from(tensor)?;
141-
texture_desc_from_tensor_slice(
141+
to_texture_desc(
142142
&tensor,
143143
slice_selection,
144144
TextureFormat::R32Float,
@@ -148,7 +148,7 @@ fn texture_desc_from_tensor(
148148
}
149149
}
150150

151-
fn texture_desc_from_tensor_slice<From: Copy, To: bytemuck::Pod>(
151+
fn to_texture_desc<From: Copy, To: bytemuck::Pod>(
152152
tensor: &ndarray::ArrayViewD<'_, From>,
153153
slice_selection: &SliceSelection,
154154
format: wgpu::TextureFormat,

0 commit comments

Comments
 (0)