Add test for mixed tensor as scalar
@@ -25,6 +25,13 @@ public class MixedTensorTestCase {
assertEquals("tensor(x{},y[3]):{}", Tensor.from("tensor(x{},y[3]):{}").toString());
}
+ @Test
+ public void testScalar() {
+ TensorType type = new TensorType.Builder().build();
+ Tensor scalar = MixedTensor.Builder.of(type).cell().value(42.0).build();
+ assertEquals(scalar.asDouble(), 42.0, 1e-6);
+ }
+
@Test
public void testOneIndexedBuilding() {
TensorType type = new TensorType.Builder().indexed("y", 3).build();
