Skip to content

Commit 575ad99

Browse files
authored
Merge pull request tensorflow#115 from bekker/scalar
dimension should be [] for scalar tensors
2 parents 90ab29f + a772db0 commit 575ad99

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -973,7 +973,7 @@ impl<T: TensorType> DerefMut for Tensor<T> {
973973

974974
impl<T: TensorType> From<T> for Tensor<T> {
975975
fn from(value: T) -> Self {
976-
let mut tensor = Tensor::new(&[1]);
976+
let mut tensor = Tensor::new(&[]);
977977
tensor[0] = value;
978978
tensor
979979
}

0 commit comments

Comments
 (0)