File size: 11,891 Bytes
03906b6 | 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 | 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) {
tensor<fp32, [128, 257]> fb = const()[name = string("fb"), val = tensor<fp32, [128, 257]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(64)))];
tensor<fp32, [514, 1, 512]> basis = const()[name = string("basis"), val = tensor<fp32, [514, 1, 512]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(131712)))];
tensor<int32, [1, 240000]> var_12 = const()[name = string("op_12"), val = tensor<int32, [1, 240000]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(1184448)))];
tensor<int32, [2]> var_15 = const()[name = string("op_15"), val = tensor<int32, [2]>([1, 1])];
tensor<int32, [1, 1]> var_16 = reshape(shape = var_15, x = audio_length)[name = string("op_16")];
tensor<bool, [1, 240000]> var_17 = less(x = var_12, y = var_16)[name = string("op_17")];
string inside_dtype_0 = const()[name = string("inside_dtype_0"), val = string("fp32")];
tensor<int32, [2]> var_32_begin_0 = const()[name = string("op_32_begin_0"), val = tensor<int32, [2]>([0, 0])];
tensor<int32, [2]> var_32_end_0 = const()[name = string("op_32_end_0"), val = tensor<int32, [2]>([1, 1])];
tensor<bool, [2]> var_32_end_mask_0 = const()[name = string("op_32_end_mask_0"), val = tensor<bool, [2]>([true, false])];
tensor<fp32, [1, 1]> var_32 = slice_by_index(begin = var_32_begin_0, end = var_32_end_0, end_mask = var_32_end_mask_0, x = audio_signal)[name = string("op_32")];
tensor<int32, [2]> var_42_begin_0 = const()[name = string("op_42_begin_0"), val = tensor<int32, [2]>([0, 1])];
tensor<int32, [2]> var_42_end_0 = const()[name = string("op_42_end_0"), val = tensor<int32, [2]>([1, 240000])];
tensor<bool, [2]> var_42_end_mask_0 = const()[name = string("op_42_end_mask_0"), val = tensor<bool, [2]>([true, true])];
tensor<fp32, [1, 239999]> var_42 = slice_by_index(begin = var_42_begin_0, end = var_42_end_0, end_mask = var_42_end_mask_0, x = audio_signal)[name = string("op_42")];
tensor<int32, [2]> var_52_begin_0 = const()[name = string("op_52_begin_0"), val = tensor<int32, [2]>([0, 0])];
tensor<int32, [2]> var_52_end_0 = const()[name = string("op_52_end_0"), val = tensor<int32, [2]>([1, 239999])];
tensor<bool, [2]> var_52_end_mask_0 = const()[name = string("op_52_end_mask_0"), val = tensor<bool, [2]>([true, false])];
tensor<fp32, [1, 239999]> var_52 = slice_by_index(begin = var_52_begin_0, end = var_52_end_0, end_mask = var_52_end_mask_0, x = audio_signal)[name = string("op_52")];
fp32 var_53 = const()[name = string("op_53"), val = fp32(0x1.f0a3d8p-1)];
tensor<fp32, [1, 239999]> var_54 = mul(x = var_52, y = var_53)[name = string("op_54")];
tensor<fp32, [1, 239999]> var_56 = sub(x = var_42, y = var_54)[name = string("op_56")];
int32 var_58 = const()[name = string("op_58"), val = int32(1)];
bool var_59_interleave_0 = const()[name = string("op_59_interleave_0"), val = bool(false)];
tensor<fp32, [1, 240000]> var_59 = concat(axis = var_58, interleave = var_59_interleave_0, values = (var_32, var_56))[name = string("op_59")];
tensor<fp32, [1, 240000]> inside = cast(dtype = inside_dtype_0, x = var_17)[name = string("cast_15")];
tensor<fp32, [1, 240000]> x = mul(x = var_59, y = inside)[name = string("x")];
tensor<int32, [1]> input_axes_0 = const()[name = string("input_axes_0"), val = tensor<int32, [1]>([1])];
tensor<fp32, [1, 1, 240000]> input = expand_dims(axes = input_axes_0, x = x)[name = string("input")];
fp32 const_2 = const()[name = string("const_2"), val = fp32(0x0p+0)];
tensor<int32, [6]> var_68_pad_0 = const()[name = string("op_68_pad_0"), val = tensor<int32, [6]>([0, 0, 0, 0, 256, 256])];
string var_68_mode_0 = const()[name = string("op_68_mode_0"), val = string("constant")];
tensor<fp32, [1, 1, 240512]> var_68 = pad(constant_val = const_2, mode = var_68_mode_0, pad = var_68_pad_0, x = input)[name = string("op_68")];
string spec_pad_type_0 = const()[name = string("spec_pad_type_0"), val = string("valid")];
tensor<int32, [1]> spec_strides_0 = const()[name = string("spec_strides_0"), val = tensor<int32, [1]>([160])];
tensor<int32, [2]> spec_pad_0 = const()[name = string("spec_pad_0"), val = tensor<int32, [2]>([0, 0])];
tensor<int32, [1]> spec_dilations_0 = const()[name = string("spec_dilations_0"), val = tensor<int32, [1]>([1])];
int32 spec_groups_0 = const()[name = string("spec_groups_0"), val = int32(1)];
tensor<fp32, [1, 514, 1501]> spec = conv(dilations = spec_dilations_0, groups = spec_groups_0, pad = spec_pad_0, pad_type = spec_pad_type_0, strides = spec_strides_0, weight = basis, x = var_68)[name = string("spec")];
tensor<int32, [3]> var_94_begin_0 = const()[name = string("op_94_begin_0"), val = tensor<int32, [3]>([0, 0, 0])];
tensor<int32, [3]> var_94_end_0 = const()[name = string("op_94_end_0"), val = tensor<int32, [3]>([1, 257, 1501])];
tensor<bool, [3]> var_94_end_mask_0 = const()[name = string("op_94_end_mask_0"), val = tensor<bool, [3]>([true, false, true])];
tensor<fp32, [1, 257, 1501]> var_94 = slice_by_index(begin = var_94_begin_0, end = var_94_end_0, end_mask = var_94_end_mask_0, x = spec)[name = string("op_94")];
fp32 var_95_promoted = const()[name = string("op_95_promoted"), val = fp32(0x1p+1)];
tensor<fp32, [1, 257, 1501]> var_96 = pow(x = var_94, y = var_95_promoted)[name = string("op_96")];
tensor<int32, [3]> var_106_begin_0 = const()[name = string("op_106_begin_0"), val = tensor<int32, [3]>([0, 257, 0])];
tensor<int32, [3]> var_106_end_0 = const()[name = string("op_106_end_0"), val = tensor<int32, [3]>([1, 514, 1501])];
tensor<bool, [3]> var_106_end_mask_0 = const()[name = string("op_106_end_mask_0"), val = tensor<bool, [3]>([true, true, true])];
tensor<fp32, [1, 257, 1501]> var_106 = slice_by_index(begin = var_106_begin_0, end = var_106_end_0, end_mask = var_106_end_mask_0, x = spec)[name = string("op_106")];
fp32 var_107_promoted = const()[name = string("op_107_promoted"), val = fp32(0x1p+1)];
tensor<fp32, [1, 257, 1501]> var_108 = pow(x = var_106, y = var_107_promoted)[name = string("op_108")];
tensor<fp32, [1, 257, 1501]> power = add(x = var_96, y = var_108)[name = string("power")];
bool var_111_transpose_x_0 = const()[name = string("op_111_transpose_x_0"), val = bool(false)];
bool var_111_transpose_y_0 = const()[name = string("op_111_transpose_y_0"), val = bool(false)];
tensor<fp32, [1, 128, 1501]> var_111 = matmul(transpose_x = var_111_transpose_x_0, transpose_y = var_111_transpose_y_0, x = fb, y = power)[name = string("op_111")];
fp32 var_113 = const()[name = string("op_113"), val = fp32(0x1p-24)];
tensor<fp32, [1, 128, 1501]> var_114 = add(x = var_111, y = var_113)[name = string("op_114")];
fp32 mel_epsilon_0 = const()[name = string("mel_epsilon_0"), val = fp32(0x1p-149)];
tensor<fp32, [1, 128, 1501]> mel_1 = log(epsilon = mel_epsilon_0, x = var_114)[name = string("mel")];
string cast_1_dtype_0 = const()[name = string("cast_1_dtype_0"), val = string("fp32")];
fp32 cast_2 = const()[name = string("cast_2"), val = fp32(0x1.4p+7)];
tensor<fp32, [1]> cast_1 = cast(dtype = cast_1_dtype_0, x = audio_length)[name = string("cast_14")];
tensor<fp32, [1]> mel_length_type_fp32 = floor_div(x = cast_1, y = cast_2)[name = string("mel_length")];
tensor<int32, [2]> var_129 = const()[name = string("op_129"), val = tensor<int32, [2]>([1, 1])];
tensor<fp32, [1, 1]> var_130 = reshape(shape = var_129, x = mel_length_type_fp32)[name = string("op_130")];
tensor<fp32, [1, 1501]> var_126_promoted = const()[name = string("op_126_promoted"), val = tensor<fp32, [1, 1501]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(2144512)))];
tensor<bool, [1, 1501]> var_131 = less(x = var_126_promoted, y = var_130)[name = string("op_131")];
string var_136_dtype_0 = const()[name = string("op_136_dtype_0"), val = string("fp32")];
tensor<int32, [1]> keep_axes_0 = const()[name = string("keep_axes_0"), val = tensor<int32, [1]>([1])];
tensor<fp32, [1, 1501]> var_136 = cast(dtype = var_136_dtype_0, x = var_131)[name = string("cast_13")];
tensor<fp32, [1, 1, 1501]> keep = expand_dims(axes = keep_axes_0, x = var_136)[name = string("keep")];
tensor<int32, [3]> var_147 = const()[name = string("op_147"), val = tensor<int32, [3]>([1, 1, 1])];
tensor<fp32, [1, 1, 1]> count = reshape(shape = var_147, x = mel_length_type_fp32)[name = string("count")];
tensor<fp32, [1, 128, 1501]> var_149 = mul(x = mel_1, y = keep)[name = string("op_149")];
tensor<int32, [1]> var_154_axes_0 = const()[name = string("op_154_axes_0"), val = tensor<int32, [1]>([2])];
bool var_154_keep_dims_0 = const()[name = string("op_154_keep_dims_0"), val = bool(true)];
tensor<fp32, [1, 128, 1]> var_154 = reduce_sum(axes = var_154_axes_0, keep_dims = var_154_keep_dims_0, x = var_149)[name = string("op_154")];
tensor<fp32, [1, 128, 1]> mean = real_div(x = var_154, y = count)[name = string("mean")];
tensor<fp32, [1, 128, 1501]> var_157 = sub(x = mel_1, y = mean)[name = string("op_157")];
tensor<fp32, [1, 128, 1501]> var_158 = mul(x = var_157, y = keep)[name = string("op_158")];
fp32 var_159_promoted = const()[name = string("op_159_promoted"), val = fp32(0x1p+1)];
tensor<fp32, [1, 128, 1501]> var_160 = pow(x = var_158, y = var_159_promoted)[name = string("op_160")];
tensor<int32, [1]> var_165_axes_0 = const()[name = string("op_165_axes_0"), val = tensor<int32, [1]>([2])];
bool var_165_keep_dims_0 = const()[name = string("op_165_keep_dims_0"), val = bool(true)];
tensor<fp32, [1, 128, 1]> var_165 = reduce_sum(axes = var_165_axes_0, keep_dims = var_165_keep_dims_0, x = var_160)[name = string("op_165")];
fp32 var_167_promoted = const()[name = string("op_167_promoted"), val = fp32(0x1p+0)];
tensor<fp32, [1, 1, 1]> var_168 = sub(x = count, y = var_167_promoted)[name = string("op_168")];
tensor<fp32, [1, 128, 1]> var_169 = real_div(x = var_165, y = var_168)[name = string("op_169")];
tensor<fp32, [1, 128, 1]> var_170 = sqrt(x = var_169)[name = string("op_170")];
fp32 var_172 = const()[name = string("op_172"), val = fp32(0x1.4f8b58p-17)];
tensor<fp32, [1, 128, 1]> std = add(x = var_170, y = var_172)[name = string("std")];
tensor<fp32, [1, 128, 1501]> var_176 = real_div(x = var_157, y = std)[name = string("op_176")];
tensor<fp32, [1, 128, 1501]> mel = mul(x = var_176, y = keep)[name = string("op_177")];
string cast_11_dtype_0 = const()[name = string("cast_11_dtype_0"), val = string("int32")];
tensor<int32, [1]> mel_length = cast(dtype = cast_11_dtype_0, x = mel_length_type_fp32)[name = string("cast_12")];
} -> (mel, mel_length);
} |