Skip to content

Commit f56a904

Browse files
committed
stamp: removing todo!() from Tensor conversions
1 parent ec76c45 commit f56a904

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

ext/ai/onnxruntime/tensor.rs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -235,12 +235,6 @@ impl JsTensor {
235235
TensorElementType::Int64 => self.extract_ort_tensor_ref::<i64>()?.into(),
236236
TensorElementType::Uint64 => self.extract_ort_tensor_ref::<u64>()?.into(),
237237
TensorElementType::Bool => self.extract_ort_tensor_ref::<bool>()?.into(),
238-
TensorElementType::Float16 => {
239-
return Err(anyhow!("'half::f16' is not supported by JS tensor."))
240-
}
241-
TensorElementType::Bfloat16 => {
242-
return Err(anyhow!("'half::bf16' is not supported by JS tensor."))
243-
}
244238
other => {
245239
return Err(anyhow!("'{other:?}' is not supported by JS tensor."))
246240
}
@@ -279,10 +273,9 @@ impl ToJsTensor {
279273
TensorElementType::Int64 => v8_slice_from!(tensor::<i64>(value)),
280274
TensorElementType::Uint64 => v8_slice_from!(tensor::<u64>(value)),
281275
TensorElementType::Bool => v8_slice_from!(tensor::<bool>(value)),
282-
TensorElementType::String => todo!(),
283-
TensorElementType::Float16 => todo!(),
284-
TensorElementType::Bfloat16 => todo!(),
285-
_ => todo!(),
276+
other => {
277+
return Err(anyhow!("'{other:?}' is not supported by JS tensor."))
278+
},
286279
};
287280

288281
Ok(Self {

0 commit comments

Comments
 (0)