File size: 17,484 Bytes
ec52e16
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
program(1.3)
[buildInfo = dict<string, string>({{"coremlc-component-MIL", "3600.16.1"}, {"coremlc-version", "3600.25.1"}, {"coremltools-component-torch", "2.7.0"}, {"coremltools-source-dialect", "TorchScript"}, {"coremltools-version", "9.0"}})]
{
    func main<ios18>(tensor<int32, [1]> audio_length, tensor<fp32, [1, 240000]> audio_signal) {
            int32 var_9 = const()[name = string("op_9"), val = int32(1)];
            int32 var_10 = const()[name = string("op_10"), val = int32(160)];
            int32 var_12 = const()[name = string("op_12"), val = int32(0)];
            int32 var_34 = const()[name = string("op_34"), val = int32(512)];
            tensor<int32, [1]> var_35 = add(x = audio_length, y = var_34)[name = string("op_35")];
            int32 var_36 = const()[name = string("op_36"), val = int32(512)];
            tensor<int32, [1]> var_37 = sub(x = var_35, y = var_36)[name = string("op_37")];
            tensor<int32, [1]> floor_div_0 = floor_div(x = var_37, y = var_10)[name = string("floor_div_0")];
            string var_38_to_fp16_dtype_0 = const()[name = string("op_38_to_fp16_dtype_0"), val = string("fp16")];
            fp16 var_39_promoted_to_fp16 = const()[name = string("op_39_promoted_to_fp16"), val = fp16(0x1p+0)];
            tensor<fp16, [1]> floor_div_0_to_fp16 = cast(dtype = var_38_to_fp16_dtype_0, x = floor_div_0)[name = string("cast_14")];
            tensor<fp16, [1]> seq_len_1_cast_fp16 = add(x = floor_div_0_to_fp16, y = var_39_promoted_to_fp16)[name = string("seq_len_1_cast_fp16")];
            string seq_len_unfixed_dtype_0 = const()[name = string("seq_len_unfixed_dtype_0"), val = string("int32")];
            tensor<bool, [1]> var_42 = equal(x = audio_length, y = var_12)[name = string("op_42")];
            tensor<int32, [1]> var_43 = const()[name = string("op_43"), val = tensor<int32, [1]>([0])];
            tensor<int32, [1]> seq_len_1_cast_fp16_to_int32 = cast(dtype = seq_len_unfixed_dtype_0, x = seq_len_1_cast_fp16)[name = string("cast_13")];
            tensor<int32, [1]> mel_length = select(a = var_43, b = seq_len_1_cast_fp16_to_int32, cond = var_42)[name = string("seq_len")];
            tensor<int32, [2]> var_46_begin_0 = const()[name = string("op_46_begin_0"), val = tensor<int32, [2]>([0, 0])];
            tensor<int32, [2]> var_46_end_0 = const()[name = string("op_46_end_0"), val = tensor<int32, [2]>([1, 1])];
            tensor<bool, [2]> var_46_end_mask_0 = const()[name = string("op_46_end_mask_0"), val = tensor<bool, [2]>([true, false])];
            tensor<bool, [2]> var_46_squeeze_mask_0 = const()[name = string("op_46_squeeze_mask_0"), val = tensor<bool, [2]>([false, true])];
            string audio_signal_to_fp16_dtype_0 = const()[name = string("audio_signal_to_fp16_dtype_0"), val = string("fp16")];
            tensor<fp16, [1, 240000]> audio_signal_to_fp16 = cast(dtype = audio_signal_to_fp16_dtype_0, x = audio_signal)[name = string("cast_12")];
            tensor<fp16, [1]> var_46_cast_fp16 = slice_by_index(begin = var_46_begin_0, end = var_46_end_0, end_mask = var_46_end_mask_0, squeeze_mask = var_46_squeeze_mask_0, x = audio_signal_to_fp16)[name = string("op_46_cast_fp16")];
            tensor<int32, [1]> var_47_axes_0 = const()[name = string("op_47_axes_0"), val = tensor<int32, [1]>([1])];
            tensor<fp16, [1, 1]> var_47_cast_fp16 = expand_dims(axes = var_47_axes_0, x = var_46_cast_fp16)[name = string("op_47_cast_fp16")];
            tensor<int32, [2]> var_49_begin_0 = const()[name = string("op_49_begin_0"), val = tensor<int32, [2]>([0, 1])];
            tensor<int32, [2]> var_49_end_0 = const()[name = string("op_49_end_0"), val = tensor<int32, [2]>([1, 240000])];
            tensor<bool, [2]> var_49_end_mask_0 = const()[name = string("op_49_end_mask_0"), val = tensor<bool, [2]>([true, true])];
            tensor<fp16, [1, 239999]> var_49_cast_fp16 = slice_by_index(begin = var_49_begin_0, end = var_49_end_0, end_mask = var_49_end_mask_0, x = audio_signal_to_fp16)[name = string("op_49_cast_fp16")];
            tensor<int32, [2]> var_51_begin_0 = const()[name = string("op_51_begin_0"), val = tensor<int32, [2]>([0, 0])];
            tensor<int32, [2]> var_51_end_0 = const()[name = string("op_51_end_0"), val = tensor<int32, [2]>([1, 239999])];
            tensor<bool, [2]> var_51_end_mask_0 = const()[name = string("op_51_end_mask_0"), val = tensor<bool, [2]>([true, false])];
            tensor<fp16, [1, 239999]> var_51_cast_fp16 = slice_by_index(begin = var_51_begin_0, end = var_51_end_0, end_mask = var_51_end_mask_0, x = audio_signal_to_fp16)[name = string("op_51_cast_fp16")];
            fp16 var_52_to_fp16 = const()[name = string("op_52_to_fp16"), val = fp16(0x1.f0cp-1)];
            tensor<fp16, [1, 239999]> var_53_cast_fp16 = mul(x = var_51_cast_fp16, y = var_52_to_fp16)[name = string("op_53_cast_fp16")];
            tensor<fp16, [1, 239999]> var_54_cast_fp16 = sub(x = var_49_cast_fp16, y = var_53_cast_fp16)[name = string("op_54_cast_fp16")];
            bool input_1_interleave_0 = const()[name = string("input_1_interleave_0"), val = bool(false)];
            tensor<fp16, [1, 240000]> input_1_cast_fp16 = concat(axis = var_9, interleave = input_1_interleave_0, values = (var_47_cast_fp16, var_54_cast_fp16))[name = string("input_1_cast_fp16")];
            tensor<int32, [3]> var_60 = const()[name = string("op_60"), val = tensor<int32, [3]>([1, 1, 240000])];
            tensor<fp16, [1, 1, 240000]> input_3_cast_fp16 = reshape(shape = var_60, x = input_1_cast_fp16)[name = string("input_3_cast_fp16")];
            tensor<int32, [6]> input_5_pad_0 = const()[name = string("input_5_pad_0"), val = tensor<int32, [6]>([0, 0, 0, 0, 256, 256])];
            string input_5_mode_0 = const()[name = string("input_5_mode_0"), val = string("reflect")];
            fp16 const_3_to_fp16 = const()[name = string("const_3_to_fp16"), val = fp16(0x0p+0)];
            tensor<fp16, [1, 1, 240512]> input_5_cast_fp16 = pad(constant_val = const_3_to_fp16, mode = input_5_mode_0, pad = input_5_pad_0, x = input_3_cast_fp16)[name = string("input_5_cast_fp16")];
            tensor<int32, [2]> var_66 = const()[name = string("op_66"), val = tensor<int32, [2]>([1, 240512])];
            tensor<fp16, [1, 240512]> input_cast_fp16 = reshape(shape = var_66, x = input_5_cast_fp16)[name = string("input_cast_fp16")];
            tensor<int32, [1]> expand_dims_5 = const()[name = string("expand_dims_5"), val = tensor<int32, [1]>([160])];
            tensor<int32, [1]> expand_dims_6_axes_0 = const()[name = string("expand_dims_6_axes_0"), val = tensor<int32, [1]>([1])];
            tensor<fp16, [1, 1, 240512]> expand_dims_6_cast_fp16 = expand_dims(axes = expand_dims_6_axes_0, x = input_cast_fp16)[name = string("expand_dims_6_cast_fp16")];
            string conv_0_pad_type_0 = const()[name = string("conv_0_pad_type_0"), val = string("valid")];
            tensor<int32, [2]> conv_0_pad_0 = const()[name = string("conv_0_pad_0"), val = tensor<int32, [2]>([0, 0])];
            tensor<int32, [1]> conv_0_dilations_0 = const()[name = string("conv_0_dilations_0"), val = tensor<int32, [1]>([1])];
            int32 conv_0_groups_0 = const()[name = string("conv_0_groups_0"), val = int32(1)];
            tensor<fp16, [257, 1, 512]> expand_dims_3_to_fp16 = const()[name = string("expand_dims_3_to_fp16"), val = tensor<fp16, [257, 1, 512]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(64)))];
            tensor<fp16, [1, 257, 1501]> conv_0_cast_fp16 = conv(dilations = conv_0_dilations_0, groups = conv_0_groups_0, pad = conv_0_pad_0, pad_type = conv_0_pad_type_0, strides = expand_dims_5, weight = expand_dims_3_to_fp16, x = expand_dims_6_cast_fp16)[name = string("conv_0_cast_fp16")];
            string conv_1_pad_type_0 = const()[name = string("conv_1_pad_type_0"), val = string("valid")];
            tensor<int32, [2]> conv_1_pad_0 = const()[name = string("conv_1_pad_0"), val = tensor<int32, [2]>([0, 0])];
            tensor<int32, [1]> conv_1_dilations_0 = const()[name = string("conv_1_dilations_0"), val = tensor<int32, [1]>([1])];
            int32 conv_1_groups_0 = const()[name = string("conv_1_groups_0"), val = int32(1)];
            tensor<fp16, [257, 1, 512]> expand_dims_4_to_fp16 = const()[name = string("expand_dims_4_to_fp16"), val = tensor<fp16, [257, 1, 512]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(263296)))];
            tensor<fp16, [1, 257, 1501]> conv_1_cast_fp16 = conv(dilations = conv_1_dilations_0, groups = conv_1_groups_0, pad = conv_1_pad_0, pad_type = conv_1_pad_type_0, strides = expand_dims_5, weight = expand_dims_4_to_fp16, x = expand_dims_6_cast_fp16)[name = string("conv_1_cast_fp16")];
            int32 stack_0_axis_0 = const()[name = string("stack_0_axis_0"), val = int32(-1)];
            tensor<fp16, [1, 257, 1501, 2]> stack_0_cast_fp16 = stack(axis = stack_0_axis_0, values = (conv_0_cast_fp16, conv_1_cast_fp16))[name = string("stack_0_cast_fp16")];
            fp16 var_18_promoted_to_fp16 = const()[name = string("op_18_promoted_to_fp16"), val = fp16(0x1p+1)];
            tensor<fp16, [1, 257, 1501, 2]> var_70_cast_fp16 = pow(x = stack_0_cast_fp16, y = var_18_promoted_to_fp16)[name = string("op_70_cast_fp16")];
            tensor<int32, [1]> var_72_axes_0 = const()[name = string("op_72_axes_0"), val = tensor<int32, [1]>([-1])];
            bool var_72_keep_dims_0 = const()[name = string("op_72_keep_dims_0"), val = bool(false)];
            tensor<fp16, [1, 257, 1501]> var_72_cast_fp16 = reduce_sum(axes = var_72_axes_0, keep_dims = var_72_keep_dims_0, x = var_70_cast_fp16)[name = string("op_72_cast_fp16")];
            tensor<fp16, [1, 257, 1501]> x_9_cast_fp16 = identity(x = var_72_cast_fp16)[name = string("x_9_cast_fp16")];
            bool x_11_transpose_x_0 = const()[name = string("x_11_transpose_x_0"), val = bool(false)];
            bool x_11_transpose_y_0 = const()[name = string("x_11_transpose_y_0"), val = bool(false)];
            tensor<fp16, [1, 128, 257]> const_6_to_fp16 = const()[name = string("const_6_to_fp16"), val = tensor<fp16, [1, 128, 257]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(526528)))];
            tensor<fp16, [1, 128, 1501]> x_11_cast_fp16 = matmul(transpose_x = x_11_transpose_x_0, transpose_y = x_11_transpose_y_0, x = const_6_to_fp16, y = x_9_cast_fp16)[name = string("x_11_cast_fp16")];
            fp16 var_79_to_fp16 = const()[name = string("op_79_to_fp16"), val = fp16(0x1p-24)];
            tensor<fp16, [1, 128, 1501]> var_80_cast_fp16 = add(x = x_11_cast_fp16, y = var_79_to_fp16)[name = string("op_80_cast_fp16")];
            fp32 x_13_epsilon_0 = const()[name = string("x_13_epsilon_0"), val = fp32(0x1p-149)];
            tensor<fp16, [1, 128, 1501]> x_13_cast_fp16 = log(epsilon = x_13_epsilon_0, x = var_80_cast_fp16)[name = string("x_13_cast_fp16")];
            tensor<int32, [1, 1501]> var_85 = const()[name = string("op_85"), val = tensor<int32, [1, 1501]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(592384)))];
            tensor<int32, [1]> var_88_axes_0 = const()[name = string("op_88_axes_0"), val = tensor<int32, [1]>([1])];
            tensor<int32, [1, 1]> var_88 = expand_dims(axes = var_88_axes_0, x = mel_length)[name = string("op_88")];
            tensor<bool, [1, 1501]> valid_mask = less(x = var_85, y = var_88)[name = string("valid_mask")];
            tensor<int32, [1]> var_90_axes_0 = const()[name = string("op_90_axes_0"), val = tensor<int32, [1]>([1])];
            tensor<bool, [1, 1, 1501]> var_90 = expand_dims(axes = var_90_axes_0, x = valid_mask)[name = string("op_90")];
            tensor<int32, [3]> var_90_after_broadcast_reps_0 = const()[name = string("op_90_after_broadcast_reps_0"), val = tensor<int32, [3]>([1, 128, 1])];
            tensor<bool, [1, 128, 1501]> var_90_after_broadcast = tile(reps = var_90_after_broadcast_reps_0, x = var_90)[name = string("op_90_after_broadcast")];
            tensor<fp16, [1, 128, 1501]> var_24_after_broadcast_to_fp16 = const()[name = string("op_24_after_broadcast_to_fp16"), val = tensor<fp16, [1, 128, 1501]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(598464)))];
            tensor<fp16, [1, 128, 1501]> var_91_cast_fp16 = select(a = x_13_cast_fp16, b = var_24_after_broadcast_to_fp16, cond = var_90_after_broadcast)[name = string("op_91_cast_fp16")];
            tensor<int32, [1]> x_mean_numerator_axes_0 = const()[name = string("x_mean_numerator_axes_0"), val = tensor<int32, [1]>([2])];
            bool x_mean_numerator_keep_dims_0 = const()[name = string("x_mean_numerator_keep_dims_0"), val = bool(false)];
            tensor<fp16, [1, 128]> x_mean_numerator_cast_fp16 = reduce_sum(axes = x_mean_numerator_axes_0, keep_dims = x_mean_numerator_keep_dims_0, x = var_91_cast_fp16)[name = string("x_mean_numerator_cast_fp16")];
            tensor<int32, [1]> x_mean_denominator_axes_0 = const()[name = string("x_mean_denominator_axes_0"), val = tensor<int32, [1]>([1])];
            bool x_mean_denominator_keep_dims_0 = const()[name = string("x_mean_denominator_keep_dims_0"), val = bool(false)];
            string cast_2_to_fp16_dtype_0 = const()[name = string("cast_2_to_fp16_dtype_0"), val = string("fp16")];
            tensor<fp16, [1, 1501]> valid_mask_to_fp16 = cast(dtype = cast_2_to_fp16_dtype_0, x = valid_mask)[name = string("cast_11")];
            tensor<fp16, [1]> x_mean_denominator_cast_fp16 = reduce_sum(axes = x_mean_denominator_axes_0, keep_dims = x_mean_denominator_keep_dims_0, x = valid_mask_to_fp16)[name = string("x_mean_denominator_cast_fp16")];
            tensor<int32, [1]> var_96_axes_0 = const()[name = string("op_96_axes_0"), val = tensor<int32, [1]>([1])];
            tensor<fp16, [1, 1]> var_96_cast_fp16 = expand_dims(axes = var_96_axes_0, x = x_mean_denominator_cast_fp16)[name = string("op_96_cast_fp16")];
            tensor<fp16, [1, 128]> x_mean_cast_fp16 = real_div(x = x_mean_numerator_cast_fp16, y = var_96_cast_fp16)[name = string("x_mean_cast_fp16")];
            tensor<int32, [1]> var_99_axes_0 = const()[name = string("op_99_axes_0"), val = tensor<int32, [1]>([2])];
            tensor<fp16, [1, 128, 1]> var_99_cast_fp16 = expand_dims(axes = var_99_axes_0, x = x_mean_cast_fp16)[name = string("op_99_cast_fp16")];
            tensor<fp16, [1, 128, 1501]> var_100_cast_fp16 = sub(x = x_13_cast_fp16, y = var_99_cast_fp16)[name = string("op_100_cast_fp16")];
            tensor<fp16, [1, 128, 1501]> var_101_cast_fp16 = select(a = var_100_cast_fp16, b = var_24_after_broadcast_to_fp16, cond = var_90_after_broadcast)[name = string("op_101_cast_fp16")];
            fp16 var_18_promoted_1_to_fp16 = const()[name = string("op_18_promoted_1_to_fp16"), val = fp16(0x1p+1)];
            tensor<fp16, [1, 128, 1501]> var_102_cast_fp16 = pow(x = var_101_cast_fp16, y = var_18_promoted_1_to_fp16)[name = string("op_102_cast_fp16")];
            tensor<int32, [1]> var_104_axes_0 = const()[name = string("op_104_axes_0"), val = tensor<int32, [1]>([2])];
            bool var_104_keep_dims_0 = const()[name = string("op_104_keep_dims_0"), val = bool(false)];
            tensor<fp16, [1, 128]> var_104_cast_fp16 = reduce_sum(axes = var_104_axes_0, keep_dims = var_104_keep_dims_0, x = var_102_cast_fp16)[name = string("op_104_cast_fp16")];
            fp16 var_106_to_fp16 = const()[name = string("op_106_to_fp16"), val = fp16(0x1p+0)];
            tensor<fp16, [1, 1]> var_107_cast_fp16 = sub(x = var_96_cast_fp16, y = var_106_to_fp16)[name = string("op_107_cast_fp16")];
            tensor<fp16, [1, 128]> var_108_cast_fp16 = real_div(x = var_104_cast_fp16, y = var_107_cast_fp16)[name = string("op_108_cast_fp16")];
            tensor<fp16, [1, 128]> x_std_1_cast_fp16 = sqrt(x = var_108_cast_fp16)[name = string("x_std_1_cast_fp16")];
            fp16 var_25_to_fp16 = const()[name = string("op_25_to_fp16"), val = fp16(0x1.5p-17)];
            tensor<fp16, [1, 128]> x_std_cast_fp16 = add(x = x_std_1_cast_fp16, y = var_25_to_fp16)[name = string("x_std_cast_fp16")];
            tensor<int32, [1]> var_113_axes_0 = const()[name = string("op_113_axes_0"), val = tensor<int32, [1]>([2])];
            tensor<fp16, [1, 128, 1]> var_113_cast_fp16 = expand_dims(axes = var_113_axes_0, x = x_std_cast_fp16)[name = string("op_113_cast_fp16")];
            tensor<fp16, [1, 128, 1501]> x_cast_fp16 = real_div(x = var_100_cast_fp16, y = var_113_cast_fp16)[name = string("x_cast_fp16")];
            tensor<bool, [1, 1501]> mask = greater_equal(x = var_85, y = var_88)[name = string("mask")];
            tensor<int32, [1]> var_122_axes_0 = const()[name = string("op_122_axes_0"), val = tensor<int32, [1]>([1])];
            tensor<bool, [1, 1, 1501]> var_122 = expand_dims(axes = var_122_axes_0, x = mask)[name = string("op_122")];
            fp16 var_24_to_fp16 = const()[name = string("op_24_to_fp16"), val = fp16(0x0p+0)];
            tensor<fp16, [1, 128, 1501]> processed_signal_cast_fp16 = select(a = var_24_to_fp16, b = x_cast_fp16, cond = var_122)[name = string("processed_signal_cast_fp16")];
            string processed_signal_cast_fp16_to_fp32_dtype_0 = const()[name = string("processed_signal_cast_fp16_to_fp32_dtype_0"), val = string("fp32")];
            tensor<fp32, [1, 128, 1501]> mel = cast(dtype = processed_signal_cast_fp16_to_fp32_dtype_0, x = processed_signal_cast_fp16)[name = string("cast_10")];
        } -> (mel, mel_length);
}