| program(1.0) | |
| [buildInfo = dict<tensor<string, []>, tensor<string, []>>({{"coremlc-component-MIL", "3500.14.1"}, {"coremlc-version", "3500.32.1"}, {"coremltools-component-torch", "2.8.0"}, {"coremltools-source-dialect", "TorchScript"}, {"coremltools-version", "9.0b1"}})] | |
| { | |
| func main<ios17>(tensor<fp32, [1, 256]> embeddings) { | |
| tensor<fp32, [128, 128]> plda_tr = const()[name = tensor<string, []>("plda_tr"), val = tensor<fp32, [128, 128]>(BLOBFILE(path = tensor<string, []>("@model_path/weights/weight.bin"), offset = tensor<uint64, []>(64)))]; | |
| tensor<fp32, [128]> mu = const()[name = tensor<string, []>("mu"), val = tensor<fp32, [128]>(BLOBFILE(path = tensor<string, []>("@model_path/weights/weight.bin"), offset = tensor<uint64, []>(65664)))]; | |
| tensor<fp32, []> lda_dim_scale = const()[name = tensor<string, []>("lda_dim_scale"), val = tensor<fp32, []>(0x1.6a09e6p+3)]; | |
| tensor<fp32, [128]> mean2 = const()[name = tensor<string, []>("mean2"), val = tensor<fp32, [128]>(BLOBFILE(path = tensor<string, []>("@model_path/weights/weight.bin"), offset = tensor<uint64, []>(66240)))]; | |
| tensor<fp32, []> lda_scale = const()[name = tensor<string, []>("lda_scale"), val = tensor<fp32, []>(0x1p+4)]; | |
| tensor<fp32, [256]> mean1 = const()[name = tensor<string, []>("mean1"), val = tensor<fp32, [256]>(BLOBFILE(path = tensor<string, []>("@model_path/weights/weight.bin"), offset = tensor<uint64, []>(66816)))]; | |
| tensor<fp32, [1, 256]> x_1 = sub(x = embeddings, y = mean1)[name = tensor<string, []>("x_1")]; | |
| tensor<fp32, [1, 256]> var_11 = mul(x = x_1, y = x_1)[name = tensor<string, []>("op_11")]; | |
| tensor<int32, [1]> var_16_axes_0 = const()[name = tensor<string, []>("op_16_axes_0"), val = tensor<int32, [1]>([-1])]; | |
| tensor<bool, []> var_16_keep_dims_0 = const()[name = tensor<string, []>("op_16_keep_dims_0"), val = tensor<bool, []>(true)]; | |
| tensor<fp32, [1, 1]> var_16 = reduce_sum(axes = var_16_axes_0, keep_dims = var_16_keep_dims_0, x = var_11)[name = tensor<string, []>("op_16")]; | |
| tensor<fp32, []> var_17 = const()[name = tensor<string, []>("op_17"), val = tensor<fp32, []>(0x1.197998p-40)]; | |
| tensor<fp32, []> const_0 = const()[name = tensor<string, []>("const_0"), val = tensor<fp32, []>(0x1.fffffep+127)]; | |
| tensor<fp32, [1, 1]> clip_0 = clip(alpha = var_17, beta = const_0, x = var_16)[name = tensor<string, []>("clip_0")]; | |
| tensor<fp32, [1, 1]> norm_1 = sqrt(x = clip_0)[name = tensor<string, []>("norm_1")]; | |
| tensor<fp32, [1, 256]> normalized1 = real_div(x = x_1, y = norm_1)[name = tensor<string, []>("normalized1")]; | |
| tensor<fp32, [128, 256]> transpose_0 = const()[name = tensor<string, []>("transpose_0"), val = tensor<fp32, [128, 256]>(BLOBFILE(path = tensor<string, []>("@model_path/weights/weight.bin"), offset = tensor<uint64, []>(67904)))]; | |
| tensor<fp32, [128]> var_22_bias_0 = const()[name = tensor<string, []>("op_22_bias_0"), val = tensor<fp32, [128]>(BLOBFILE(path = tensor<string, []>("@model_path/weights/weight.bin"), offset = tensor<uint64, []>(199040)))]; | |
| tensor<fp32, [1, 128]> var_22 = linear(bias = var_22_bias_0, weight = transpose_0, x = normalized1)[name = tensor<string, []>("op_22")]; | |
| tensor<fp32, [1, 128]> projected = mul(x = var_22, y = lda_scale)[name = tensor<string, []>("projected")]; | |
| tensor<fp32, [1, 128]> x = sub(x = projected, y = mean2)[name = tensor<string, []>("x")]; | |
| tensor<fp32, [1, 128]> var_26 = mul(x = x, y = x)[name = tensor<string, []>("op_26")]; | |
| tensor<int32, [1]> var_31_axes_0 = const()[name = tensor<string, []>("op_31_axes_0"), val = tensor<int32, [1]>([-1])]; | |
| tensor<bool, []> var_31_keep_dims_0 = const()[name = tensor<string, []>("op_31_keep_dims_0"), val = tensor<bool, []>(true)]; | |
| tensor<fp32, [1, 1]> var_31 = reduce_sum(axes = var_31_axes_0, keep_dims = var_31_keep_dims_0, x = var_26)[name = tensor<string, []>("op_31")]; | |
| tensor<fp32, []> var_32 = const()[name = tensor<string, []>("op_32"), val = tensor<fp32, []>(0x1.197998p-40)]; | |
| tensor<fp32, []> const_1 = const()[name = tensor<string, []>("const_1"), val = tensor<fp32, []>(0x1.fffffep+127)]; | |
| tensor<fp32, [1, 1]> clip_1 = clip(alpha = var_32, beta = const_1, x = var_31)[name = tensor<string, []>("clip_1")]; | |
| tensor<fp32, [1, 1]> norm = sqrt(x = clip_1)[name = tensor<string, []>("norm")]; | |
| tensor<fp32, [1, 128]> var_36 = real_div(x = x, y = norm)[name = tensor<string, []>("op_36")]; | |
| tensor<fp32, [1, 128]> normalized2 = mul(x = var_36, y = lda_dim_scale)[name = tensor<string, []>("normalized2")]; | |
| tensor<fp32, [1, 128]> plda_centered = sub(x = normalized2, y = mu)[name = tensor<string, []>("plda_centered")]; | |
| tensor<fp32, [1, 128]> plda_features = linear(bias = var_22_bias_0, weight = plda_tr, x = plda_centered)[name = tensor<string, []>("op_41")]; | |
| } -> (plda_features); | |
| } |