Add some very simple sum benchmark. (#108)

* Add some very simple sum benchmark.

* Rename the file.
This commit is contained in:
Laurent Mazare
2023-07-08 08:39:27 +01:00
committed by GitHub
parent f35cfc5e97
commit 33479c5f1b
3 changed files with 56 additions and 35 deletions

View File

@ -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>() {