aoiandroid's picture
Duplicate from FluidInference/parakeet-realtime-eou-120m-coreml
1b8ea0e
program(1.0)
[buildInfo = dict<tensor<string, []>, tensor<string, []>>({{"coremlc-component-MIL", "3500.14.1"}, {"coremlc-version", "3500.32.1"}, {"coremltools-component-torch", "2.4.0"}, {"coremltools-source-dialect", "TorchScript"}, {"coremltools-version", "8.3.0"}})]
{
func main<ios17>(tensor<int32, [1]> audio_length, tensor<fp32, [1, ?]> audio_signal) [FlexibleShapeInformation = tuple<tuple<tensor<string, []>, dict<tensor<string, []>, tensor<int32, [?]>>>, tuple<tensor<string, []>, dict<tensor<string, []>, list<tensor<int32, [2]>, ?>>>>((("DefaultShapes", {{"audio_signal", [1, 1]}}), ("RangeDims", {{"audio_signal", [[1, 1], [1, 32000]]}})))] {
tensor<int32, []> var_9 = const()[name = tensor<string, []>("op_9"), val = tensor<int32, []>(1)];
tensor<int32, []> var_10 = const()[name = tensor<string, []>("op_10"), val = tensor<int32, []>(160)];
tensor<int32, []> var_32 = const()[name = tensor<string, []>("op_32"), val = tensor<int32, []>(512)];
tensor<int32, [1]> var_33 = add(x = audio_length, y = var_32)[name = tensor<string, []>("op_33")];
tensor<int32, []> var_34 = const()[name = tensor<string, []>("op_34"), val = tensor<int32, []>(512)];
tensor<int32, [1]> var_35 = sub(x = var_33, y = var_34)[name = tensor<string, []>("op_35")];
tensor<int32, [1]> floor_div_0 = floor_div(x = var_35, y = var_10)[name = tensor<string, []>("floor_div_0")];
tensor<string, []> var_36_dtype_0 = const()[name = tensor<string, []>("op_36_dtype_0"), val = tensor<string, []>("fp32")];
tensor<fp32, []> var_37_promoted = const()[name = tensor<string, []>("op_37_promoted"), val = tensor<fp32, []>(0x1p+0)];
tensor<fp32, [1]> var_36 = cast(dtype = var_36_dtype_0, x = floor_div_0)[name = tensor<string, []>("cast_11")];
tensor<fp32, [1]> seq_len_1 = add(x = var_36, y = var_37_promoted)[name = tensor<string, []>("seq_len_1")];
tensor<string, []> cast_2_dtype_0 = const()[name = tensor<string, []>("cast_2_dtype_0"), val = tensor<string, []>("int32")];
tensor<int32, [2]> var_41_begin_0 = const()[name = tensor<string, []>("op_41_begin_0"), val = tensor<int32, [2]>([0, 0])];
tensor<int32, [2]> var_41_end_0 = const()[name = tensor<string, []>("op_41_end_0"), val = tensor<int32, [2]>([1, 1])];
tensor<bool, [2]> var_41_end_mask_0 = const()[name = tensor<string, []>("op_41_end_mask_0"), val = tensor<bool, [2]>([true, false])];
tensor<bool, [2]> var_41_squeeze_mask_0 = const()[name = tensor<string, []>("op_41_squeeze_mask_0"), val = tensor<bool, [2]>([false, true])];
tensor<fp32, [1]> var_41 = slice_by_index(begin = var_41_begin_0, end = var_41_end_0, end_mask = var_41_end_mask_0, squeeze_mask = var_41_squeeze_mask_0, x = audio_signal)[name = tensor<string, []>("op_41")];
tensor<int32, [1]> var_42_axes_0 = const()[name = tensor<string, []>("op_42_axes_0"), val = tensor<int32, [1]>([1])];
tensor<fp32, [1, 1]> var_42 = expand_dims(axes = var_42_axes_0, x = var_41)[name = tensor<string, []>("op_42")];
tensor<int32, [2]> var_44_begin_0 = const()[name = tensor<string, []>("op_44_begin_0"), val = tensor<int32, [2]>([0, 1])];
tensor<int32, [2]> var_44_end_0 = const()[name = tensor<string, []>("op_44_end_0"), val = tensor<int32, [2]>([1, 0])];
tensor<bool, [2]> var_44_end_mask_0 = const()[name = tensor<string, []>("op_44_end_mask_0"), val = tensor<bool, [2]>([true, true])];
tensor<fp32, [1, ?]> var_44 = slice_by_index(begin = var_44_begin_0, end = var_44_end_0, end_mask = var_44_end_mask_0, x = audio_signal)[name = tensor<string, []>("op_44")];
tensor<int32, [2]> var_46_begin_0 = const()[name = tensor<string, []>("op_46_begin_0"), val = tensor<int32, [2]>([0, 0])];
tensor<int32, [2]> var_46_end_0 = const()[name = tensor<string, []>("op_46_end_0"), val = tensor<int32, [2]>([1, -1])];
tensor<bool, [2]> var_46_end_mask_0 = const()[name = tensor<string, []>("op_46_end_mask_0"), val = tensor<bool, [2]>([true, false])];
tensor<fp32, [1, ?]> var_46 = slice_by_index(begin = var_46_begin_0, end = var_46_end_0, end_mask = var_46_end_mask_0, x = audio_signal)[name = tensor<string, []>("op_46")];
tensor<fp32, []> var_47 = const()[name = tensor<string, []>("op_47"), val = tensor<fp32, []>(0x1.f0a3d8p-1)];
tensor<fp32, [1, ?]> var_48 = mul(x = var_46, y = var_47)[name = tensor<string, []>("op_48")];
tensor<fp32, [1, ?]> var_49 = sub(x = var_44, y = var_48)[name = tensor<string, []>("op_49")];
tensor<bool, []> input_1_interleave_0 = const()[name = tensor<string, []>("input_1_interleave_0"), val = tensor<bool, []>(false)];
tensor<fp32, [1, ?]> input_1 = concat(axis = var_9, interleave = input_1_interleave_0, values = (var_42, var_49))[name = tensor<string, []>("input_1")];
tensor<int32, [3]> concat_0x = const()[name = tensor<string, []>("concat_0x"), val = tensor<int32, [3]>([1, 1, -1])];
tensor<fp32, [1, 1, ?]> input_3 = reshape(shape = concat_0x, x = input_1)[name = tensor<string, []>("input_3")];
tensor<fp32, []> const_1 = const()[name = tensor<string, []>("const_1"), val = tensor<fp32, []>(0x0p+0)];
tensor<int32, [6]> input_5_pad_0 = const()[name = tensor<string, []>("input_5_pad_0"), val = tensor<int32, [6]>([0, 0, 0, 0, 256, 256])];
tensor<string, []> input_5_mode_0 = const()[name = tensor<string, []>("input_5_mode_0"), val = tensor<string, []>("reflect")];
tensor<fp32, [1, 1, ?]> input_5 = pad(constant_val = const_1, mode = input_5_mode_0, pad = input_5_pad_0, x = input_3)[name = tensor<string, []>("input_5")];
tensor<int32, [2]> concat_1x = const()[name = tensor<string, []>("concat_1x"), val = tensor<int32, [2]>([1, -1])];
tensor<fp32, [1, ?]> input = reshape(shape = concat_1x, x = input_5)[name = tensor<string, []>("input")];
tensor<fp32, [257, 1, 512]> expand_dims_1 = const()[name = tensor<string, []>("expand_dims_1"), val = tensor<fp32, [257, 1, 512]>(BLOBFILE(path = tensor<string, []>("@model_path/weights/weight.bin"), offset = tensor<uint64, []>(64)))];
tensor<fp32, [257, 1, 512]> expand_dims_2 = const()[name = tensor<string, []>("expand_dims_2"), val = tensor<fp32, [257, 1, 512]>(BLOBFILE(path = tensor<string, []>("@model_path/weights/weight.bin"), offset = tensor<uint64, []>(526464)))];
tensor<int32, [1]> expand_dims_3 = const()[name = tensor<string, []>("expand_dims_3"), val = tensor<int32, [1]>([160])];
tensor<int32, [1]> expand_dims_4_axes_0 = const()[name = tensor<string, []>("expand_dims_4_axes_0"), val = tensor<int32, [1]>([1])];
tensor<fp32, [1, 1, ?]> expand_dims_4 = expand_dims(axes = expand_dims_4_axes_0, x = input)[name = tensor<string, []>("expand_dims_4")];
tensor<string, []> conv_0_pad_type_0 = const()[name = tensor<string, []>("conv_0_pad_type_0"), val = tensor<string, []>("valid")];
tensor<int32, [2]> conv_0_pad_0 = const()[name = tensor<string, []>("conv_0_pad_0"), val = tensor<int32, [2]>([0, 0])];
tensor<int32, [1]> conv_0_dilations_0 = const()[name = tensor<string, []>("conv_0_dilations_0"), val = tensor<int32, [1]>([1])];
tensor<int32, []> conv_0_groups_0 = const()[name = tensor<string, []>("conv_0_groups_0"), val = tensor<int32, []>(1)];
tensor<fp32, [1, 257, ?]> conv_0 = 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_3, weight = expand_dims_1, x = expand_dims_4)[name = tensor<string, []>("conv_0")];
tensor<string, []> conv_1_pad_type_0 = const()[name = tensor<string, []>("conv_1_pad_type_0"), val = tensor<string, []>("valid")];
tensor<int32, [2]> conv_1_pad_0 = const()[name = tensor<string, []>("conv_1_pad_0"), val = tensor<int32, [2]>([0, 0])];
tensor<int32, [1]> conv_1_dilations_0 = const()[name = tensor<string, []>("conv_1_dilations_0"), val = tensor<int32, [1]>([1])];
tensor<int32, []> conv_1_groups_0 = const()[name = tensor<string, []>("conv_1_groups_0"), val = tensor<int32, []>(1)];
tensor<fp32, [1, 257, ?]> conv_1 = 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_3, weight = expand_dims_2, x = expand_dims_4)[name = tensor<string, []>("conv_1")];
tensor<int32, []> stack_0_axis_0 = const()[name = tensor<string, []>("stack_0_axis_0"), val = tensor<int32, []>(-1)];
tensor<fp32, [1, 257, ?, 2]> stack_0 = stack(axis = stack_0_axis_0, values = (conv_0, conv_1))[name = tensor<string, []>("stack_0")];
tensor<fp32, []> var_17_promoted = const()[name = tensor<string, []>("op_17_promoted"), val = tensor<fp32, []>(0x1p+1)];
tensor<fp32, [1, 257, ?, 2]> var_65 = pow(x = stack_0, y = var_17_promoted)[name = tensor<string, []>("op_65")];
tensor<int32, [1]> var_67_axes_0 = const()[name = tensor<string, []>("op_67_axes_0"), val = tensor<int32, [1]>([-1])];
tensor<bool, []> var_67_keep_dims_0 = const()[name = tensor<string, []>("op_67_keep_dims_0"), val = tensor<bool, []>(false)];
tensor<fp32, [1, 257, ?]> var_67 = reduce_sum(axes = var_67_axes_0, keep_dims = var_67_keep_dims_0, x = var_65)[name = tensor<string, []>("op_67")];
tensor<fp32, [1, 257, ?]> x_9 = identity(x = var_67)[name = tensor<string, []>("x_9")];
tensor<fp32, [1, 128, 257]> const_2 = const()[name = tensor<string, []>("const_2"), val = tensor<fp32, [1, 128, 257]>(BLOBFILE(path = tensor<string, []>("@model_path/weights/weight.bin"), offset = tensor<uint64, []>(1052864)))];
tensor<bool, []> x_11_transpose_x_0 = const()[name = tensor<string, []>("x_11_transpose_x_0"), val = tensor<bool, []>(false)];
tensor<bool, []> x_11_transpose_y_0 = const()[name = tensor<string, []>("x_11_transpose_y_0"), val = tensor<bool, []>(false)];
tensor<fp32, [1, 128, ?]> x_11 = matmul(transpose_x = x_11_transpose_x_0, transpose_y = x_11_transpose_y_0, x = const_2, y = x_9)[name = tensor<string, []>("x_11")];
tensor<fp32, []> var_74 = const()[name = tensor<string, []>("op_74"), val = tensor<fp32, []>(0x1p-24)];
tensor<fp32, [1, 128, ?]> var_75 = add(x = x_11, y = var_74)[name = tensor<string, []>("op_75")];
tensor<fp32, []> x_epsilon_0 = const()[name = tensor<string, []>("x_epsilon_0"), val = tensor<fp32, []>(0x1p-149)];
tensor<fp32, [1, 128, ?]> x = log(epsilon = x_epsilon_0, x = var_75)[name = tensor<string, []>("x")];
tensor<int32, [3]> var_77_shape = shape(x = x)[name = tensor<string, []>("op_77_shape")];
tensor<int32, []> select_4 = const()[name = tensor<string, []>("select_4"), val = tensor<int32, []>(2)];
tensor<int32, []> gather_4_axis_0 = const()[name = tensor<string, []>("gather_4_axis_0"), val = tensor<int32, []>(0)];
tensor<int32, []> gather_4_batch_dims_0 = const()[name = tensor<string, []>("gather_4_batch_dims_0"), val = tensor<int32, []>(0)];
tensor<bool, []> gather_4_validate_indices_0 = const()[name = tensor<string, []>("gather_4_validate_indices_0"), val = tensor<bool, []>(false)];
tensor<int32, []> gather_4 = gather(axis = gather_4_axis_0, batch_dims = gather_4_batch_dims_0, indices = select_4, validate_indices = gather_4_validate_indices_0, x = var_77_shape)[name = tensor<string, []>("gather_4")];
tensor<int32, []> const_3 = const()[name = tensor<string, []>("const_3"), val = tensor<int32, []>(0)];
tensor<int32, []> const_4 = const()[name = tensor<string, []>("const_4"), val = tensor<int32, []>(1)];
tensor<int32, [?]> mask_1 = range_1d(end = gather_4, start = const_3, step = const_4)[name = tensor<string, []>("mask_1")];
tensor<int32, [1]> expand_dims_0_axes_0 = const()[name = tensor<string, []>("expand_dims_0_axes_0"), val = tensor<int32, [1]>([0])];
tensor<int32, [1, ?]> expand_dims_0 = expand_dims(axes = expand_dims_0_axes_0, x = mask_1)[name = tensor<string, []>("expand_dims_0")];
tensor<int32, [1]> var_82_axes_0 = const()[name = tensor<string, []>("op_82_axes_0"), val = tensor<int32, [1]>([1])];
tensor<int32, [1]> mel_length = cast(dtype = cast_2_dtype_0, x = seq_len_1)[name = tensor<string, []>("cast_10")];
tensor<int32, [1, 1]> var_82 = expand_dims(axes = var_82_axes_0, x = mel_length)[name = tensor<string, []>("op_82")];
tensor<bool, [1, ?]> mask = greater_equal(x = expand_dims_0, y = var_82)[name = tensor<string, []>("mask")];
tensor<int32, [1]> var_84_axes_0 = const()[name = tensor<string, []>("op_84_axes_0"), val = tensor<int32, [1]>([1])];
tensor<bool, [1, 1, ?]> var_84 = expand_dims(axes = var_84_axes_0, x = mask)[name = tensor<string, []>("op_84")];
tensor<fp32, []> cast_7 = const()[name = tensor<string, []>("cast_7"), val = tensor<fp32, []>(0x0p+0)];
tensor<fp32, [1, 128, ?]> mel = select(a = cast_7, b = x, cond = var_84)[name = tensor<string, []>("processed_signal")];
} -> (mel, mel_length);
}