Example #1
0
def test_compress_model_transformation():
    node_constant = ov.opset8.constant(np.array([[0.0, 0.1, -0.1], [-2.5, 2.5, 3.0]], dtype=np.float32))
    node_ceil = ov.opset8.ceiling(node_constant)
    func = Model(node_ceil, [], "TestFunction")
    assert func.get_ordered_ops()[0].get_element_type().get_type_name() == "f32"
    compress_model_transformation(func)

    assert func is not None
    assert func.get_ordered_ops()[0].get_element_type().get_type_name() == "f16"
def compress_model(func: object):
    from openvino.offline_transformations import compress_model_transformation  # pylint: disable=import-error,no-name-in-module
    compress_model_transformation(func)