program(1.0) [buildInfo = dict, tensor>({{"coremlc-component-MIL", "3605.1.1"}, {"coremlc-version", "3600.25.1"}, {"coremltools-component-torch", "2.9.1"}, {"coremltools-source-dialect", "TorchScript"}, {"coremltools-version", "9.0"}})] { func main(tensor c_in, tensor encoder, tensor h_in, tensor token, tensor token_length) { tensor y_batch_dims_0 = const()[name = tensor("y_batch_dims_0"), val = tensor(0)]; tensor y_validate_indices_0 = const()[name = tensor("y_validate_indices_0"), val = tensor(false)]; tensor decoder_prediction_embed_weight_to_fp16 = const()[name = tensor("decoder_prediction_embed_weight_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(64)))]; tensor token_to_int16_dtype_0 = const()[name = tensor("token_to_int16_dtype_0"), val = tensor("int16")]; tensor cast_4_dtype_0 = const()[name = tensor("cast_4_dtype_0"), val = tensor("int32")]; tensor greater_equal_0_y_0 = const()[name = tensor("greater_equal_0_y_0"), val = tensor(0)]; tensor token_to_int16 = cast(dtype = token_to_int16_dtype_0, x = token)[name = tensor("cast_10")]; tensor cast_4 = cast(dtype = cast_4_dtype_0, x = token_to_int16)[name = tensor("cast_9")]; tensor greater_equal_0 = greater_equal(x = cast_4, y = greater_equal_0_y_0)[name = tensor("greater_equal_0")]; tensor slice_by_index_0 = const()[name = tensor("slice_by_index_0"), val = tensor(1025)]; tensor add_2 = add(x = cast_4, y = slice_by_index_0)[name = tensor("add_2")]; tensor select_0 = select(a = cast_4, b = add_2, cond = greater_equal_0)[name = tensor("select_0")]; tensor y_cast_fp16_cast_uint16_axis_0 = const()[name = tensor("y_cast_fp16_cast_uint16_axis_0"), val = tensor(0)]; tensor select_0_to_int16_dtype_0 = const()[name = tensor("select_0_to_int16_dtype_0"), val = tensor("int16")]; tensor select_0_to_int16 = cast(dtype = select_0_to_int16_dtype_0, x = select_0)[name = tensor("cast_8")]; tensor y_cast_fp16_cast_uint16_cast_uint16 = gather(axis = y_cast_fp16_cast_uint16_axis_0, batch_dims = y_batch_dims_0, indices = select_0_to_int16, validate_indices = y_validate_indices_0, x = decoder_prediction_embed_weight_to_fp16)[name = tensor("y_cast_fp16_cast_uint16_cast_uint16")]; tensor input_1_perm_0 = const()[name = tensor("input_1_perm_0"), val = tensor([1, 0, 2])]; tensor split_0_num_splits_0 = const()[name = tensor("split_0_num_splits_0"), val = tensor(2)]; tensor split_0_axis_0 = const()[name = tensor("split_0_axis_0"), val = tensor(0)]; tensor h_in_to_fp16_dtype_0 = const()[name = tensor("h_in_to_fp16_dtype_0"), val = tensor("fp16")]; tensor h_in_to_fp16 = cast(dtype = h_in_to_fp16_dtype_0, x = h_in)[name = tensor("cast_7")]; tensor split_0_cast_fp16_0, tensor split_0_cast_fp16_1 = split(axis = split_0_axis_0, num_splits = split_0_num_splits_0, x = h_in_to_fp16)[name = tensor("split_0_cast_fp16")]; tensor split_1_num_splits_0 = const()[name = tensor("split_1_num_splits_0"), val = tensor(2)]; tensor split_1_axis_0 = const()[name = tensor("split_1_axis_0"), val = tensor(0)]; tensor c_in_to_fp16_dtype_0 = const()[name = tensor("c_in_to_fp16_dtype_0"), val = tensor("fp16")]; tensor c_in_to_fp16 = cast(dtype = c_in_to_fp16_dtype_0, x = c_in)[name = tensor("cast_6")]; tensor split_1_cast_fp16_0, tensor split_1_cast_fp16_1 = split(axis = split_1_axis_0, num_splits = split_1_num_splits_0, x = c_in_to_fp16)[name = tensor("split_1_cast_fp16")]; tensor input_3_lstm_layer_0_lstm_h0_squeeze_axes_0 = const()[name = tensor("input_3_lstm_layer_0_lstm_h0_squeeze_axes_0"), val = tensor([0])]; tensor input_3_lstm_layer_0_lstm_h0_squeeze_cast_fp16 = squeeze(axes = input_3_lstm_layer_0_lstm_h0_squeeze_axes_0, x = split_0_cast_fp16_0)[name = tensor("input_3_lstm_layer_0_lstm_h0_squeeze_cast_fp16")]; tensor input_3_lstm_layer_0_lstm_c0_squeeze_axes_0 = const()[name = tensor("input_3_lstm_layer_0_lstm_c0_squeeze_axes_0"), val = tensor([0])]; tensor input_3_lstm_layer_0_lstm_c0_squeeze_cast_fp16 = squeeze(axes = input_3_lstm_layer_0_lstm_c0_squeeze_axes_0, x = split_1_cast_fp16_0)[name = tensor("input_3_lstm_layer_0_lstm_c0_squeeze_cast_fp16")]; tensor input_3_lstm_layer_0_direction_0 = const()[name = tensor("input_3_lstm_layer_0_direction_0"), val = tensor("forward")]; tensor input_3_lstm_layer_0_output_sequence_0 = const()[name = tensor("input_3_lstm_layer_0_output_sequence_0"), val = tensor(true)]; tensor input_3_lstm_layer_0_recurrent_activation_0 = const()[name = tensor("input_3_lstm_layer_0_recurrent_activation_0"), val = tensor("sigmoid")]; tensor input_3_lstm_layer_0_cell_activation_0 = const()[name = tensor("input_3_lstm_layer_0_cell_activation_0"), val = tensor("tanh")]; tensor input_3_lstm_layer_0_activation_0 = const()[name = tensor("input_3_lstm_layer_0_activation_0"), val = tensor("tanh")]; tensor concat_1_to_fp16 = const()[name = tensor("concat_1_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(1312128)))]; tensor concat_2_to_fp16 = const()[name = tensor("concat_2_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(4588992)))]; tensor concat_0_to_fp16 = const()[name = tensor("concat_0_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(7865856)))]; tensor input_1_cast_fp16 = transpose(perm = input_1_perm_0, x = y_cast_fp16_cast_uint16_cast_uint16)[name = tensor("transpose_2")]; tensor input_3_lstm_layer_0_cast_fp16_0, tensor input_3_lstm_layer_0_cast_fp16_1, tensor input_3_lstm_layer_0_cast_fp16_2 = lstm(activation = input_3_lstm_layer_0_activation_0, bias = concat_0_to_fp16, cell_activation = input_3_lstm_layer_0_cell_activation_0, direction = input_3_lstm_layer_0_direction_0, initial_c = input_3_lstm_layer_0_lstm_c0_squeeze_cast_fp16, initial_h = input_3_lstm_layer_0_lstm_h0_squeeze_cast_fp16, output_sequence = input_3_lstm_layer_0_output_sequence_0, recurrent_activation = input_3_lstm_layer_0_recurrent_activation_0, weight_hh = concat_2_to_fp16, weight_ih = concat_1_to_fp16, x = input_1_cast_fp16)[name = tensor("input_3_lstm_layer_0_cast_fp16")]; tensor input_3_lstm_h0_squeeze_axes_0 = const()[name = tensor("input_3_lstm_h0_squeeze_axes_0"), val = tensor([0])]; tensor input_3_lstm_h0_squeeze_cast_fp16 = squeeze(axes = input_3_lstm_h0_squeeze_axes_0, x = split_0_cast_fp16_1)[name = tensor("input_3_lstm_h0_squeeze_cast_fp16")]; tensor input_3_lstm_c0_squeeze_axes_0 = const()[name = tensor("input_3_lstm_c0_squeeze_axes_0"), val = tensor([0])]; tensor input_3_lstm_c0_squeeze_cast_fp16 = squeeze(axes = input_3_lstm_c0_squeeze_axes_0, x = split_1_cast_fp16_1)[name = tensor("input_3_lstm_c0_squeeze_cast_fp16")]; tensor input_3_direction_0 = const()[name = tensor("input_3_direction_0"), val = tensor("forward")]; tensor input_3_output_sequence_0 = const()[name = tensor("input_3_output_sequence_0"), val = tensor(true)]; tensor input_3_recurrent_activation_0 = const()[name = tensor("input_3_recurrent_activation_0"), val = tensor("sigmoid")]; tensor input_3_cell_activation_0 = const()[name = tensor("input_3_cell_activation_0"), val = tensor("tanh")]; tensor input_3_activation_0 = const()[name = tensor("input_3_activation_0"), val = tensor("tanh")]; tensor concat_4_to_fp16 = const()[name = tensor("concat_4_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(7871040)))]; tensor concat_5_to_fp16 = const()[name = tensor("concat_5_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(11147904)))]; tensor concat_3_to_fp16 = const()[name = tensor("concat_3_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(14424768)))]; tensor input_3_cast_fp16_0, tensor input_3_cast_fp16_1, tensor input_3_cast_fp16_2 = lstm(activation = input_3_activation_0, bias = concat_3_to_fp16, cell_activation = input_3_cell_activation_0, direction = input_3_direction_0, initial_c = input_3_lstm_c0_squeeze_cast_fp16, initial_h = input_3_lstm_h0_squeeze_cast_fp16, output_sequence = input_3_output_sequence_0, recurrent_activation = input_3_recurrent_activation_0, weight_hh = concat_5_to_fp16, weight_ih = concat_4_to_fp16, x = input_3_lstm_layer_0_cast_fp16_0)[name = tensor("input_3_cast_fp16")]; tensor var_41_axis_0 = const()[name = tensor("op_41_axis_0"), val = tensor(0)]; tensor h_out = stack(axis = var_41_axis_0, values = (input_3_lstm_layer_0_cast_fp16_1, input_3_cast_fp16_1))[name = tensor("op_41_cast_fp16")]; tensor var_42_axis_0 = const()[name = tensor("op_42_axis_0"), val = tensor(0)]; tensor c_out = stack(axis = var_42_axis_0, values = (input_3_lstm_layer_0_cast_fp16_2, input_3_cast_fp16_2))[name = tensor("op_42_cast_fp16")]; tensor input_7_perm_0 = const()[name = tensor("input_7_perm_0"), val = tensor([1, 0, 2])]; tensor input_5_perm_0 = const()[name = tensor("input_5_perm_0"), val = tensor([0, 2, 1])]; tensor encoder_to_fp16_dtype_0 = const()[name = tensor("encoder_to_fp16_dtype_0"), val = tensor("fp16")]; tensor joint_enc_weight_to_fp16 = const()[name = tensor("joint_enc_weight_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(14429952)))]; tensor joint_enc_bias_to_fp16 = const()[name = tensor("joint_enc_bias_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(15740736)))]; tensor encoder_to_fp16 = cast(dtype = encoder_to_fp16_dtype_0, x = encoder)[name = tensor("cast_5")]; tensor input_5_cast_fp16 = transpose(perm = input_5_perm_0, x = encoder_to_fp16)[name = tensor("transpose_0")]; tensor linear_0_cast_fp16 = linear(bias = joint_enc_bias_to_fp16, weight = joint_enc_weight_to_fp16, x = input_5_cast_fp16)[name = tensor("linear_0_cast_fp16")]; tensor joint_pred_weight_to_fp16 = const()[name = tensor("joint_pred_weight_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(15742080)))]; tensor joint_pred_bias_to_fp16 = const()[name = tensor("joint_pred_bias_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(16561344)))]; tensor input_7_cast_fp16 = transpose(perm = input_7_perm_0, x = input_3_cast_fp16_0)[name = tensor("transpose_1")]; tensor linear_1_cast_fp16 = linear(bias = joint_pred_bias_to_fp16, weight = joint_pred_weight_to_fp16, x = input_7_cast_fp16)[name = tensor("linear_1_cast_fp16")]; tensor f_axes_0 = const()[name = tensor("f_axes_0"), val = tensor([2])]; tensor f_cast_fp16 = expand_dims(axes = f_axes_0, x = linear_0_cast_fp16)[name = tensor("f_cast_fp16")]; tensor g_axes_0 = const()[name = tensor("g_axes_0"), val = tensor([1])]; tensor g_cast_fp16 = expand_dims(axes = g_axes_0, x = linear_1_cast_fp16)[name = tensor("g_cast_fp16")]; tensor input_9_cast_fp16 = add(x = f_cast_fp16, y = g_cast_fp16)[name = tensor("input_9_cast_fp16")]; tensor input_11_cast_fp16 = relu(x = input_9_cast_fp16)[name = tensor("input_11_cast_fp16")]; tensor joint_joint_net_2_weight_to_fp16 = const()[name = tensor("joint_joint_net_2_weight_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(16562688)))]; tensor joint_joint_net_2_bias_to_fp16 = const()[name = tensor("joint_joint_net_2_bias_to_fp16"), val = tensor(BLOBFILE(path = tensor("@model_path/weights/weight.bin"), offset = tensor(17874752)))]; tensor linear_2_cast_fp16 = linear(bias = joint_joint_net_2_bias_to_fp16, weight = joint_joint_net_2_weight_to_fp16, x = input_11_cast_fp16)[name = tensor("linear_2_cast_fp16")]; tensor var_78 = const()[name = tensor("op_78"), val = tensor(-1)]; tensor var_80_softmax_cast_fp16 = softmax(axis = var_78, x = linear_2_cast_fp16)[name = tensor("op_80_softmax_cast_fp16")]; tensor var_80_epsilon_0 = const()[name = tensor("op_80_epsilon_0"), val = tensor(0x1p-149)]; tensor logits = log(epsilon = var_80_epsilon_0, x = var_80_softmax_cast_fp16)[name = tensor("op_80_cast_fp16")]; tensor token_length_tmp = identity(x = token_length)[name = tensor("token_length_tmp")]; } -> (logits, h_out, c_out); }