def test_num_passed_to_Tensor_creates_scalar_tensor( num: Union[primitive_types, numpy_types], expected_java_class: str) -> None: t = Tensor(num) assert_java_class(t, expected_java_class) assert t.is_scalar() assert t.scalar() == num
def test_ndarray_passed_to_Tensor_creates_nonscalar_tensor(arr: primitive_types, expected_java_class: str) -> None: ndarray = np.array(arr) t = Tensor(ndarray) assert_java_class(t, expected_java_class) assert not t.is_scalar()
def test_ndarray_passed_to_Tensor_creates_nonscalar_tensor(arr: primitive_types) -> None: ndarray = np.array(arr) t = Tensor(ndarray) assert not t.is_scalar()
def test_num_passed_to_Tensor_creates_scalar_tensor(num: Union[primitive_types, numpy_types]) -> None: t = Tensor(num) assert t.is_scalar() assert t.scalar() == num