def test_from_scalar(): x = Tensor.from_scalar(-2.0) assert x.order == 0 assert x.dimensions == () assert x.modes == () assert x.mode_ordering == () assert x.format == Format((), ()) assert x.to_dok() == {(): -2.0}
def test_to_float(): x = Tensor.from_scalar(2.0) assert float(x) == 2.0