def unary_op(op_str, a): if op_str == "Abs": return ov.abs(a) elif op_str == "Acos": return ov.acos(a) elif op_str == "Acosh": return ov.acosh(a) elif op_str == "Asin": return ov.asin(a) elif op_str == "Asinh": return ov.asinh(a) elif op_str == "Atan": return ov.atan(a) elif op_str == "Atanh": return ov.atanh(a) elif op_str == "Ceiling": return ov.ceiling(a) elif op_str == "Cos": return ov.cos(a) elif op_str == "Cosh": return ov.cosh(a) elif op_str == "Floor": return ov.floor(a) elif op_str == "log": return ov.log(a) elif op_str == "exp": return ov.exp(a) elif op_str == "negative": return ov.negative(a) elif op_str == "Sign": return ov.sign(a) elif op_str == "Sin": return ov.sin(a) elif op_str == "Sinh": return ov.sinh(a) elif op_str == "Sqrt": return ov.sqrt(a) elif op_str == "Tan": return ov.tan(a) elif op_str == "Tanh": return ov.tanh(a)
def test_discrete_type_info(): data_shape = [6, 12, 10, 24] data_parameter = ov.parameter(data_shape, name="Data", dtype=np.float32) k = np.int32(3) axis = np.int32(1) n1 = ov.topk(data_parameter, k, axis, "max", "value") n2 = ov.topk(data_parameter, k, axis, "max", "value") n3 = ov.sin(0.2) assert n1.type_info.name == "TopK" assert n3.type_info.name == "Sin" assert n1.get_type_info().name == "TopK" assert n3.get_type_info().name == "Sin" assert n1.type_info.name == n2.type_info.name assert n1.type_info.version == n2.type_info.version assert n1.type_info.parent == n2.type_info.parent assert n1.get_type_info().name == n2.get_type_info().name assert n1.get_type_info().version == n2.get_type_info().version assert n1.get_type_info().parent == n2.get_type_info().parent assert n1.get_type_info().name != n3.get_type_info().name assert n1.get_type_info().name > n3.get_type_info().name assert n1.get_type_info().name >= n3.get_type_info().name assert n3.get_type_info().name < n1.get_type_info().name assert n3.get_type_info().name <= n1.get_type_info().name