| program(1.3) |
| [buildInfo = dict<string, string>({{"coremlc-component-MIL", "3520.4.1"}, {"coremlc-version", "3520.5.1"}, {"coremltools-component-torch", "2.6.0"}, {"coremltools-source-dialect", "TorchScript"}, {"coremltools-version", "8.3.0"}})] |
| { |
| func main<ios18>(tensor<fp32, [1, 1, 1]> emotion_adv, tensor<int32, [1, 150]> prompt_speech_tokens, tensor<fp32, [1, 256]> speaker_emb) { |
| int32 prompt_emb_1_axis_0 = const()[name = string("prompt_emb_1_axis_0"), val = int32(0)]; |
| int32 prompt_emb_1_batch_dims_0 = const()[name = string("prompt_emb_1_batch_dims_0"), val = int32(0)]; |
| bool prompt_emb_1_validate_indices_0 = const()[name = string("prompt_emb_1_validate_indices_0"), val = bool(false)]; |
| tensor<fp16, [8195, 1024]> speech_emb_weight_to_fp16 = const()[name = string("speech_emb_weight_to_fp16"), val = tensor<fp16, [8195, 1024]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(64)))]; |
| string prompt_speech_tokens_to_int16_dtype_0 = const()[name = string("prompt_speech_tokens_to_int16_dtype_0"), val = string("int16")]; |
| tensor<int16, [1, 150]> prompt_speech_tokens_to_int16 = cast(dtype = prompt_speech_tokens_to_int16_dtype_0, x = prompt_speech_tokens)[name = string("cast_18")]; |
| tensor<fp16, [1, 150, 1024]> prompt_emb_1_cast_fp16_cast_uint16 = gather(axis = prompt_emb_1_axis_0, batch_dims = prompt_emb_1_batch_dims_0, indices = prompt_speech_tokens_to_int16, validate_indices = prompt_emb_1_validate_indices_0, x = speech_emb_weight_to_fp16)[name = string("prompt_emb_1_cast_fp16_cast_uint16")]; |
| tensor<fp16, [150, 1024]> var_31_to_fp16 = const()[name = string("op_31_to_fp16"), val = tensor<fp16, [150, 1024]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(16783488)))]; |
| tensor<fp16, [1, 150, 1024]> h_1_cast_fp16 = add(x = prompt_emb_1_cast_fp16_cast_uint16, y = var_31_to_fp16)[name = string("h_1_cast_fp16")]; |
| string speaker_emb_to_fp16_dtype_0 = const()[name = string("speaker_emb_to_fp16_dtype_0"), val = string("fp16")]; |
| tensor<fp16, [1024, 256]> cond_enc_spkr_enc_weight_to_fp16 = const()[name = string("cond_enc_spkr_enc_weight_to_fp16"), val = tensor<fp16, [1024, 256]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(17090752)))]; |
| tensor<fp16, [1024]> cond_enc_spkr_enc_bias_to_fp16 = const()[name = string("cond_enc_spkr_enc_bias_to_fp16"), val = tensor<fp16, [1024]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(17615104)))]; |
| tensor<fp16, [1, 256]> speaker_emb_to_fp16 = cast(dtype = speaker_emb_to_fp16_dtype_0, x = speaker_emb)[name = string("cast_17")]; |
| tensor<fp16, [1, 1024]> linear_0_cast_fp16 = linear(bias = cond_enc_spkr_enc_bias_to_fp16, weight = cond_enc_spkr_enc_weight_to_fp16, x = speaker_emb_to_fp16)[name = string("linear_0_cast_fp16")]; |
| tensor<int32, [1]> cond_spkr_axes_0 = const()[name = string("cond_spkr_axes_0"), val = tensor<int32, [1]>([1])]; |
| tensor<fp16, [1, 1, 1024]> cond_spkr_cast_fp16 = expand_dims(axes = cond_spkr_axes_0, x = linear_0_cast_fp16)[name = string("cond_spkr_cast_fp16")]; |
| tensor<int32, [1]> input_9_axes_0 = const()[name = string("input_9_axes_0"), val = tensor<int32, [1]>([-1])]; |
| tensor<fp16, [1024]> cond_enc_perceiver_attn_norm_weight_to_fp16 = const()[name = string("cond_enc_perceiver_attn_norm_weight_to_fp16"), val = tensor<fp16, [1024]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(17617216)))]; |
| tensor<fp16, [1024]> cond_enc_perceiver_attn_norm_bias_to_fp16 = const()[name = string("cond_enc_perceiver_attn_norm_bias_to_fp16"), val = tensor<fp16, [1024]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(17619328)))]; |
| fp16 var_51_to_fp16 = const()[name = string("op_51_to_fp16"), val = fp16(0x1.5p-17)]; |
| tensor<fp16, [1, 150, 1024]> input_9_cast_fp16 = layer_norm(axes = input_9_axes_0, beta = cond_enc_perceiver_attn_norm_bias_to_fp16, epsilon = var_51_to_fp16, gamma = cond_enc_perceiver_attn_norm_weight_to_fp16, x = h_1_cast_fp16)[name = string("input_9_cast_fp16")]; |
| tensor<fp16, [1024, 1024]> cond_enc_perceiver_attn_to_k_weight_to_fp16 = const()[name = string("cond_enc_perceiver_attn_to_k_weight_to_fp16"), val = tensor<fp16, [1024, 1024]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(17621440)))]; |
| tensor<fp16, [1024]> cond_enc_perceiver_attn_to_k_bias_to_fp16 = const()[name = string("cond_enc_perceiver_attn_to_k_bias_to_fp16"), val = tensor<fp16, [1024]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(19718656)))]; |
| tensor<fp16, [1, 150, 1024]> linear_2_cast_fp16 = linear(bias = cond_enc_perceiver_attn_to_k_bias_to_fp16, weight = cond_enc_perceiver_attn_to_k_weight_to_fp16, x = input_9_cast_fp16)[name = string("linear_2_cast_fp16")]; |
| tensor<fp16, [1024, 1024]> cond_enc_perceiver_attn_to_v_weight_to_fp16 = const()[name = string("cond_enc_perceiver_attn_to_v_weight_to_fp16"), val = tensor<fp16, [1024, 1024]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(19720768)))]; |
| tensor<fp16, [1024]> cond_enc_perceiver_attn_to_v_bias_to_fp16 = const()[name = string("cond_enc_perceiver_attn_to_v_bias_to_fp16"), val = tensor<fp16, [1024]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(21817984)))]; |
| tensor<fp16, [1, 150, 1024]> linear_3_cast_fp16 = linear(bias = cond_enc_perceiver_attn_to_v_bias_to_fp16, weight = cond_enc_perceiver_attn_to_v_weight_to_fp16, x = input_9_cast_fp16)[name = string("linear_3_cast_fp16")]; |
| tensor<int32, [4]> var_99 = const()[name = string("op_99"), val = tensor<int32, [4]>([1, 150, 4, 256])]; |
| tensor<fp16, [1, 150, 4, 256]> x_7_cast_fp16 = reshape(shape = var_99, x = linear_2_cast_fp16)[name = string("x_7_cast_fp16")]; |
| tensor<int32, [4]> var_105 = const()[name = string("op_105"), val = tensor<int32, [4]>([1, 150, 4, 256])]; |
| tensor<fp16, [1, 150, 4, 256]> x_11_cast_fp16 = reshape(shape = var_105, x = linear_3_cast_fp16)[name = string("x_11_cast_fp16")]; |
| tensor<fp16, [1, 4, 32, 256]> q_1_to_fp16 = const()[name = string("q_1_to_fp16"), val = tensor<fp16, [1, 4, 32, 256]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(21820096)))]; |
| tensor<int32, [4]> transpose_10_perm_0 = const()[name = string("transpose_10_perm_0"), val = tensor<int32, [4]>([0, 2, 1, 3])]; |
| tensor<int32, [4]> transpose_11_perm_0 = const()[name = string("transpose_11_perm_0"), val = tensor<int32, [4]>([0, 2, 1, 3])]; |
| tensor<fp16, [1, 4, 150, 256]> transpose_11 = transpose(perm = transpose_11_perm_0, x = x_11_cast_fp16)[name = string("transpose_20")]; |
| tensor<fp16, [1, 4, 150, 256]> transpose_10 = transpose(perm = transpose_10_perm_0, x = x_7_cast_fp16)[name = string("transpose_21")]; |
| tensor<fp16, [1, 4, 32, 256]> x_13_cast_fp16 = scaled_dot_product_attention(key = transpose_10, query = q_1_to_fp16, value = transpose_11)[name = string("x_13_cast_fp16")]; |
| tensor<int32, [4]> var_112 = const()[name = string("op_112"), val = tensor<int32, [4]>([0, 2, 1, 3])]; |
| tensor<int32, [3]> var_115 = const()[name = string("op_115"), val = tensor<int32, [3]>([1, 32, -1])]; |
| tensor<fp16, [1, 32, 4, 256]> var_113_cast_fp16 = transpose(perm = var_112, x = x_13_cast_fp16)[name = string("transpose_19")]; |
| tensor<fp16, [1, 32, 1024]> input_11_cast_fp16 = reshape(shape = var_115, x = var_113_cast_fp16)[name = string("input_11_cast_fp16")]; |
| tensor<fp16, [1024, 1024]> cond_enc_perceiver_attn_proj_out_weight_to_fp16 = const()[name = string("cond_enc_perceiver_attn_proj_out_weight_to_fp16"), val = tensor<fp16, [1024, 1024]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(21885696)))]; |
| tensor<fp16, [1024]> cond_enc_perceiver_attn_proj_out_bias_to_fp16 = const()[name = string("cond_enc_perceiver_attn_proj_out_bias_to_fp16"), val = tensor<fp16, [1024]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(23982912)))]; |
| tensor<fp16, [1, 32, 1024]> linear_4_cast_fp16 = linear(bias = cond_enc_perceiver_attn_proj_out_bias_to_fp16, weight = cond_enc_perceiver_attn_proj_out_weight_to_fp16, x = input_11_cast_fp16)[name = string("linear_4_cast_fp16")]; |
| tensor<fp16, [1, 32, 1024]> cond_enc_perceiver_pre_attention_query_to_fp16 = const()[name = string("cond_enc_perceiver_pre_attention_query_to_fp16"), val = tensor<fp16, [1, 32, 1024]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(23985024)))]; |
| tensor<fp16, [1, 32, 1024]> var_120_cast_fp16 = add(x = cond_enc_perceiver_pre_attention_query_to_fp16, y = linear_4_cast_fp16)[name = string("op_120_cast_fp16")]; |
| tensor<int32, [1]> input_13_axes_0 = const()[name = string("input_13_axes_0"), val = tensor<int32, [1]>([-1])]; |
| tensor<fp16, [1, 32, 1024]> input_13_cast_fp16 = layer_norm(axes = input_13_axes_0, beta = cond_enc_perceiver_attn_norm_bias_to_fp16, epsilon = var_51_to_fp16, gamma = cond_enc_perceiver_attn_norm_weight_to_fp16, x = var_120_cast_fp16)[name = string("input_13_cast_fp16")]; |
| tensor<fp16, [1024, 1024]> cond_enc_perceiver_attn_to_q_weight_to_fp16 = const()[name = string("cond_enc_perceiver_attn_to_q_weight_to_fp16"), val = tensor<fp16, [1024, 1024]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(24050624)))]; |
| tensor<fp16, [1024]> cond_enc_perceiver_attn_to_q_bias_to_fp16 = const()[name = string("cond_enc_perceiver_attn_to_q_bias_to_fp16"), val = tensor<fp16, [1024]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(26147840)))]; |
| tensor<fp16, [1, 32, 1024]> linear_5_cast_fp16 = linear(bias = cond_enc_perceiver_attn_to_q_bias_to_fp16, weight = cond_enc_perceiver_attn_to_q_weight_to_fp16, x = input_13_cast_fp16)[name = string("linear_5_cast_fp16")]; |
| tensor<fp16, [1, 32, 1024]> linear_6_cast_fp16 = linear(bias = cond_enc_perceiver_attn_to_k_bias_to_fp16, weight = cond_enc_perceiver_attn_to_k_weight_to_fp16, x = input_13_cast_fp16)[name = string("linear_6_cast_fp16")]; |
| tensor<fp16, [1, 32, 1024]> linear_7_cast_fp16 = linear(bias = cond_enc_perceiver_attn_to_v_bias_to_fp16, weight = cond_enc_perceiver_attn_to_v_weight_to_fp16, x = input_13_cast_fp16)[name = string("linear_7_cast_fp16")]; |
| tensor<int32, [4]> var_150 = const()[name = string("op_150"), val = tensor<int32, [4]>([1, 32, 4, 256])]; |
| tensor<fp16, [1, 32, 4, 256]> x_19_cast_fp16 = reshape(shape = var_150, x = linear_5_cast_fp16)[name = string("x_19_cast_fp16")]; |
| tensor<int32, [4]> var_156 = const()[name = string("op_156"), val = tensor<int32, [4]>([1, 32, 4, 256])]; |
| tensor<fp16, [1, 32, 4, 256]> x_23_cast_fp16 = reshape(shape = var_156, x = linear_6_cast_fp16)[name = string("x_23_cast_fp16")]; |
| tensor<int32, [4]> var_162 = const()[name = string("op_162"), val = tensor<int32, [4]>([1, 32, 4, 256])]; |
| tensor<fp16, [1, 32, 4, 256]> x_27_cast_fp16 = reshape(shape = var_162, x = linear_7_cast_fp16)[name = string("x_27_cast_fp16")]; |
| tensor<int32, [4]> transpose_12_perm_0 = const()[name = string("transpose_12_perm_0"), val = tensor<int32, [4]>([0, 2, 1, 3])]; |
| tensor<int32, [4]> transpose_13_perm_0 = const()[name = string("transpose_13_perm_0"), val = tensor<int32, [4]>([0, 2, 1, 3])]; |
| tensor<int32, [4]> transpose_14_perm_0 = const()[name = string("transpose_14_perm_0"), val = tensor<int32, [4]>([0, 2, 1, 3])]; |
| tensor<fp16, [1, 4, 32, 256]> transpose_14 = transpose(perm = transpose_14_perm_0, x = x_27_cast_fp16)[name = string("transpose_16")]; |
| tensor<fp16, [1, 4, 32, 256]> transpose_13 = transpose(perm = transpose_13_perm_0, x = x_23_cast_fp16)[name = string("transpose_17")]; |
| tensor<fp16, [1, 4, 32, 256]> transpose_12 = transpose(perm = transpose_12_perm_0, x = x_19_cast_fp16)[name = string("transpose_18")]; |
| tensor<fp16, [1, 4, 32, 256]> x_29_cast_fp16 = scaled_dot_product_attention(key = transpose_13, query = transpose_12, value = transpose_14)[name = string("x_29_cast_fp16")]; |
| tensor<int32, [4]> var_169 = const()[name = string("op_169"), val = tensor<int32, [4]>([0, 2, 1, 3])]; |
| tensor<int32, [3]> var_172 = const()[name = string("op_172"), val = tensor<int32, [3]>([1, 32, -1])]; |
| tensor<fp16, [1, 32, 4, 256]> var_170_cast_fp16 = transpose(perm = var_169, x = x_29_cast_fp16)[name = string("transpose_15")]; |
| tensor<fp16, [1, 32, 1024]> input_17_cast_fp16 = reshape(shape = var_172, x = var_170_cast_fp16)[name = string("input_17_cast_fp16")]; |
| tensor<fp16, [1, 32, 1024]> linear_8_cast_fp16 = linear(bias = cond_enc_perceiver_attn_proj_out_bias_to_fp16, weight = cond_enc_perceiver_attn_proj_out_weight_to_fp16, x = input_17_cast_fp16)[name = string("linear_8_cast_fp16")]; |
| tensor<fp16, [1, 32, 1024]> var_177_cast_fp16 = add(x = var_120_cast_fp16, y = linear_8_cast_fp16)[name = string("op_177_cast_fp16")]; |
| string emotion_adv_to_fp16_dtype_0 = const()[name = string("emotion_adv_to_fp16_dtype_0"), val = string("fp16")]; |
| tensor<fp16, [1024, 1]> cond_enc_emotion_adv_fc_weight_to_fp16 = const()[name = string("cond_enc_emotion_adv_fc_weight_to_fp16"), val = tensor<fp16, [1024, 1]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(26149952)))]; |
| tensor<fp16, [1024]> linear_9_bias_0_to_fp16 = const()[name = string("linear_9_bias_0_to_fp16"), val = tensor<fp16, [1024]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(26152064)))]; |
| tensor<fp16, [1, 1, 1]> emotion_adv_to_fp16 = cast(dtype = emotion_adv_to_fp16_dtype_0, x = emotion_adv)[name = string("cast_16")]; |
| tensor<fp16, [1, 1, 1024]> linear_9_cast_fp16 = linear(bias = linear_9_bias_0_to_fp16, weight = cond_enc_emotion_adv_fc_weight_to_fp16, x = emotion_adv_to_fp16)[name = string("linear_9_cast_fp16")]; |
| int32 var_189 = const()[name = string("op_189"), val = int32(1)]; |
| bool var_190_interleave_0 = const()[name = string("op_190_interleave_0"), val = bool(false)]; |
| tensor<fp16, [1, 34, 1024]> cond_emb = concat(axis = var_189, interleave = var_190_interleave_0, values = (cond_spkr_cast_fp16, var_177_cast_fp16, linear_9_cast_fp16))[name = string("op_190_cast_fp16")]; |
| } -> (cond_emb); |
| } |