summaryrefslogtreecommitdiff
path: root/candle-core/src/display.rs
diff options
context:
space:
mode:
Diffstat (limited to 'candle-core/src/display.rs')
-rw-r--r--candle-core/src/display.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/candle-core/src/display.rs b/candle-core/src/display.rs
index 60907bb3..127e55b0 100644
--- a/candle-core/src/display.rs
+++ b/candle-core/src/display.rs
@@ -9,7 +9,11 @@ impl Tensor {
&self,
f: &mut std::fmt::Formatter,
) -> std::fmt::Result {
- write!(f, "Tensor[")?;
+ let prefix = match self.device() {
+ crate::Device::Cpu => "Cpu",
+ crate::Device::Cuda(_) => "Cuda",
+ };
+ write!(f, "{prefix}Tensor[")?;
match self.dims() {
[] => {
if let Ok(v) = self.to_scalar::<T>() {