Add backtrace information to errors where relevant. (#166)

* Add backtrace information to errors where relevant.

* More backtrace information.

* Add to the FAQ.
This commit is contained in:
Laurent Mazare
2023-07-14 09:31:25 +01:00
committed by GitHub
parent a2f72edc0d
commit d88b6cdca9
11 changed files with 153 additions and 73 deletions

View File

@ -38,7 +38,7 @@ impl Storage {
let lhs = self.device().location();
let rhs = rhs.device().location();
if lhs != rhs {
Err(Error::DeviceMismatchBinaryOp { lhs, rhs, op })
Err(Error::DeviceMismatchBinaryOp { lhs, rhs, op }.bt())
} else {
Ok(())
}
@ -48,7 +48,7 @@ impl Storage {
let lhs = self.dtype();
let rhs = rhs.dtype();
if lhs != rhs {
Err(Error::DTypeMismatchBinaryOp { lhs, rhs, op })
Err(Error::DTypeMismatchBinaryOp { lhs, rhs, op }.bt())
} else {
Ok(())
}
@ -153,7 +153,8 @@ impl Storage {
lhs: lhs.device().location(),
rhs: rhs.device().location(),
op: B::NAME,
})
}
.bt())
}
}
}
@ -180,7 +181,8 @@ impl Storage {
lhs: lhs.device().location(),
rhs: rhs.device().location(),
op: "conv1d",
}),
}
.bt()),
}
}
@ -208,7 +210,8 @@ impl Storage {
lhs: lhs.device().location(),
rhs: rhs.device().location(),
op: "where",
}),
}
.bt()),
}
}
@ -227,7 +230,8 @@ impl Storage {
lhs: lhs.device().location(),
rhs: rhs.device().location(),
op: "embedding",
}),
}
.bt()),
}
}
@ -253,7 +257,8 @@ impl Storage {
lhs: lhs.device().location(),
rhs: rhs.device().location(),
op: "matmul",
}),
}
.bt()),
}
}
@ -271,7 +276,8 @@ impl Storage {
lhs: lhs.device().location(),
rhs: rhs.device().location(),
op: "copy",
}),
}
.bt()),
}
}
}