cdef SizeVector shape
if len(representation_shape) == 0:
shape = desc.getDims()
+ if layout_int_to_str_map[desc.getLayout()] == 'SCALAR':
+ shape = [1]
else:
shape = representation_shape
cdef Py_ssize_t itemsize = deref(ptr).element_size()
assert np.array_equal(blob.buffer, ones_arr)
+def test_write_numpy_scalar_int64():
+ tensor_desc = TensorDesc("I64", [], "SCALAR")
+ scalar = np.array(0, dtype=np.int64)
+ blob = Blob(tensor_desc, scalar)
+ scalar_to_write = np.array(1, dtype=np.int64)
+ blob.buffer[:] = scalar_to_write
+ assert np.array_equal(blob.buffer, np.atleast_1d(scalar_to_write))
+
+
def test_incompatible_array_and_td():
tensor_desc = TensorDesc("FP32", [1, 3, 127, 127], "NCHW")
array = np.zeros(shape=(1, 2, 3, 4), dtype=np.float32)
xfail_issue_35912 = xfail_test(reason="RuntimeError: Error of validate layer: B with type: "
"Pad. Cannot parse parameter pads_end from IR for layer B. "
"Value -1,0 cannot be casted to int.")
-xfail_issue_35914 = xfail_test(reason="IndexError: too many indices for array: "
- "array is 0-dimensional, but 1 were indexed")
xfail_issue_35915 = xfail_test(reason="RuntimeError: Eltwise node with unsupported combination "
"of input and output types")
xfail_issue_35916 = xfail_test(reason="RuntimeError: Unsupported input dims count for layer Z")
xfail_issue_38086,
xfail_issue_38087,
xfail_issue_35923,
- xfail_issue_35914,
xfail_issue_36483,
xfail_issue_34323,
xfail_issue_35915,
(xfail_issue_35923,
"OnnxBackendNodeModelTest.test_prelu_broadcast_cpu",
"OnnxBackendNodeModelTest.test_prelu_example_cpu"),
- (xfail_issue_35914,
- "OnnxBackendNodeModelTest.test_dequantizelinear_cpu",
- "OnnxBackendNodeModelTest.test_pow_bcast_scalar_cpu",
- "OnnxBackendNodeModelTest.test_clip_example_cpu",
- "OnnxBackendNodeModelTest.test_clip_inbounds_cpu",
- "OnnxBackendNodeModelTest.test_clip_outbounds_cpu",
- "OnnxBackendNodeModelTest.test_clip_default_int8_min_cpu",
- "OnnxBackendNodeModelTest.test_clip_default_int8_max_cpu",
- "OnnxBackendNodeModelTest.test_gemm_default_scalar_bias_cpu",
- "OnnxBackendNodeModelTest.test_clip_cpu",
- "OnnxBackendNodeModelTest.test_clip_default_max_cpu",
- "OnnxBackendNodeModelTest.test_clip_default_min_cpu",
- "OnnxBackendNodeModelTest.test_clip_splitbounds_cpu"),
(xfail_issue_36483,
"OnnxBackendNodeModelTest.test_ceil_cpu",
"OnnxBackendNodeModelTest.test_ceil_example_cpu"),
"OnnxBackendNodeModelTest.test_and_bcast4v4d_cpu",
"OnnxBackendNodeModelTest.test_argmin_no_keepdims_example_cpu",
"OnnxBackendNodeModelTest.test_clip_default_int8_inbounds_cpu",
- "OnnxBackendNodeModelTest.test_and2d_cpu"),
+ "OnnxBackendNodeModelTest.test_and2d_cpu",
+ "OnnxBackendNodeModelTest.test_clip_default_int8_min_cpu",
+ "OnnxBackendNodeModelTest.test_clip_default_int8_max_cpu"),
(xfail_issue_38091,
"OnnxBackendNodeModelTest.test_round_cpu",
"OnnxBackendNodeModelTest.test_mvn_cpu",
import pytest
from tests.test_onnx.utils import run_node
-from tests import xfail_issue_35914, xfail_issue_35915
+from tests import xfail_issue_35915
@pytest.mark.parametrize(
"onnx_op, numpy_func, data_type",
[
- pytest.param("And", np.logical_and, np.bool, marks=xfail_issue_35914),
- pytest.param("Or", np.logical_or, np.bool, marks=xfail_issue_35914),
- pytest.param("Xor", np.logical_xor, np.bool, marks=xfail_issue_35914),
+ pytest.param("And", np.logical_and, np.bool),
+ pytest.param("Or", np.logical_or, np.bool),
+ pytest.param("Xor", np.logical_xor, np.bool),
pytest.param("Equal", np.equal, np.int32, marks=xfail_issue_35915),
pytest.param("Greater", np.greater, np.int32, marks=xfail_issue_35915),
pytest.param("Less", np.less, np.int32, marks=xfail_issue_35915),