summaryrefslogtreecommitdiff
path: root/candle-nn
diff options
context:
space:
mode:
authorNicolas Patry <patry.nicolas@protonmail.com>2023-12-15 12:23:28 +0100
committerNicolas Patry <patry.nicolas@protonmail.com>2023-12-15 12:23:28 +0100
commitaa040150985e78079bcc05df86266e447c23b4fc (patch)
treeacd041686876adc4a3335a41724746c28640447f /candle-nn
parent8b5059e95178cd0bf369906717319b8eef2cd8a8 (diff)
downloadcandle-aa040150985e78079bcc05df86266e447c23b4fc.tar.gz
candle-aa040150985e78079bcc05df86266e447c23b4fc.tar.bz2
candle-aa040150985e78079bcc05df86266e447c23b4fc.zip
Remove `unwrap()`.
Diffstat (limited to 'candle-nn')
-rw-r--r--candle-nn/src/ops.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/candle-nn/src/ops.rs b/candle-nn/src/ops.rs
index ca23f90e..94380f12 100644
--- a/candle-nn/src/ops.rs
+++ b/candle-nn/src/ops.rs
@@ -210,7 +210,7 @@ impl candle::CustomOp1 for SoftmaxLastDim {
) -> Result<(candle::MetalStorage, Shape)> {
use candle::{backend::BackendStorage, DType};
let device = storage.device();
- let command_buffer = device.command_buffer();
+ let command_buffer = device.command_buffer()?;
let kernels = device.kernels();
let name = match storage.dtype() {
DType::F32 => "softmax_f32",
@@ -226,7 +226,7 @@ impl candle::CustomOp1 for SoftmaxLastDim {
let last_dim = layout.dims()[layout.shape().rank() - 1];
let elem_count = layout.shape().elem_count();
- let mut output = device.new_buffer(elem_count, storage.dtype(), "softmax");
+ let mut output = device.new_buffer(elem_count, storage.dtype(), "softmax")?;
candle_metal_kernels::call_last_softmax(
device.metal_device(),
&command_buffer,