| program(1.3) |
| [buildInfo = dict<string, string>({{"coremlc-component-MIL", "3520.4.1"}, {"coremlc-version", "3520.5.1"}, {"coremltools-component-torch", "2.11.0"}, {"coremltools-source-dialect", "TorchScript"}, {"coremltools-version", "9.0"}})] |
| { |
| func main<ios18>(tensor<int32, [1]> input_lengths, tensor<fp32, [1, ?]> text_mask, tensor<int32, [1, ?]> tokens) [FlexibleShapeInformation = tuple<tuple<string, dict<string, tensor<int32, [?]>>>, tuple<string, dict<string, list<tensor<int32, [2]>, ?>>>>((("DefaultShapes", {{"text_mask", [1, 57]}, {"tokens", [1, 57]}}), ("RangeDims", {{"text_mask", [[1, 1], [1, 512]]}, {"tokens", [[1, 1], [1, 512]]}})))] { |
| int32 x_1_batch_dims_0 = const()[name = string("x_1_batch_dims_0"), val = int32(0)]; |
| bool x_1_validate_indices_0 = const()[name = string("x_1_validate_indices_0"), val = bool(false)]; |
| tensor<fp16, [178, 512]> text_encoder_embedding_weight_to_fp16 = const()[name = string("text_encoder_embedding_weight_to_fp16"), val = tensor<fp16, [178, 512]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(64)))]; |
| string tokens_to_int16_dtype_0 = const()[name = string("tokens_to_int16_dtype_0"), val = string("int16")]; |
| string cast_2_dtype_0 = const()[name = string("cast_2_dtype_0"), val = string("int32")]; |
| int32 greater_equal_0_y_0 = const()[name = string("greater_equal_0_y_0"), val = int32(0)]; |
| tensor<int16, [1, ?]> tokens_to_int16 = cast(dtype = tokens_to_int16_dtype_0, x = tokens)[name = string("cast_6")]; |
| tensor<int32, [1, ?]> cast_2 = cast(dtype = cast_2_dtype_0, x = tokens_to_int16)[name = string("cast_5")]; |
| tensor<bool, [1, ?]> greater_equal_0 = greater_equal(x = cast_2, y = greater_equal_0_y_0)[name = string("greater_equal_0")]; |
| int32 slice_by_index_0 = const()[name = string("slice_by_index_0"), val = int32(178)]; |
| tensor<int32, [1, ?]> add_2 = add(x = cast_2, y = slice_by_index_0)[name = string("add_2")]; |
| tensor<int32, [1, ?]> select_0 = select(a = cast_2, b = add_2, cond = greater_equal_0)[name = string("select_0")]; |
| int32 x_1_cast_fp16_cast_uint16_axis_0 = const()[name = string("x_1_cast_fp16_cast_uint16_axis_0"), val = int32(0)]; |
| string select_0_to_int16_dtype_0 = const()[name = string("select_0_to_int16_dtype_0"), val = string("int16")]; |
| tensor<int16, [1, ?]> select_0_to_int16 = cast(dtype = select_0_to_int16_dtype_0, x = select_0)[name = string("cast_4")]; |
| tensor<fp16, [1, ?, 512]> x_1_cast_fp16_cast_uint16_cast_uint16 = gather(axis = x_1_cast_fp16_cast_uint16_axis_0, batch_dims = x_1_batch_dims_0, indices = select_0_to_int16, validate_indices = x_1_validate_indices_0, x = text_encoder_embedding_weight_to_fp16)[name = string("x_1_cast_fp16_cast_uint16_cast_uint16")]; |
| tensor<int32, [3]> x_3_perm_0 = const()[name = string("x_3_perm_0"), val = tensor<int32, [3]>([0, 2, 1])]; |
| tensor<int32, [1]> var_30_axes_0 = const()[name = string("op_30_axes_0"), val = tensor<int32, [1]>([1])]; |
| string text_mask_to_fp16_dtype_0 = const()[name = string("text_mask_to_fp16_dtype_0"), val = string("fp16")]; |
| tensor<fp16, [1, ?]> text_mask_to_fp16 = cast(dtype = text_mask_to_fp16_dtype_0, x = text_mask)[name = string("cast_3")]; |
| tensor<fp16, [1, 1, ?]> var_30_cast_fp16 = expand_dims(axes = var_30_axes_0, x = text_mask_to_fp16)[name = string("op_30_cast_fp16")]; |
| fp16 var_31_to_fp16 = const()[name = string("op_31_to_fp16"), val = fp16(0x1p+0)]; |
| tensor<fp16, [1, 1, ?]> keep_cast_fp16 = sub(x = var_31_to_fp16, y = var_30_cast_fp16)[name = string("keep_cast_fp16")]; |
| tensor<fp16, [1, 512, ?]> x_3_cast_fp16 = transpose(perm = x_3_perm_0, x = x_1_cast_fp16_cast_uint16_cast_uint16)[name = string("transpose_10")]; |
| tensor<fp16, [1, 512, ?]> input_1_cast_fp16 = mul(x = x_3_cast_fp16, y = keep_cast_fp16)[name = string("input_1_cast_fp16")]; |
| fp32 var_35 = const()[name = string("op_35"), val = fp32(0x1.99999ap-3)]; |
| string x_5_pad_type_0 = const()[name = string("x_5_pad_type_0"), val = string("custom")]; |
| tensor<int32, [2]> x_5_pad_0 = const()[name = string("x_5_pad_0"), val = tensor<int32, [2]>([2, 2])]; |
| tensor<int32, [1]> x_5_strides_0 = const()[name = string("x_5_strides_0"), val = tensor<int32, [1]>([1])]; |
| tensor<int32, [1]> x_5_dilations_0 = const()[name = string("x_5_dilations_0"), val = tensor<int32, [1]>([1])]; |
| int32 x_5_groups_0 = const()[name = string("x_5_groups_0"), val = int32(1)]; |
| tensor<fp16, [512, 512, 5]> weight_3_to_fp16 = const()[name = string("weight_3_to_fp16"), val = tensor<fp16, [512, 512, 5]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(182400)))]; |
| tensor<fp16, [512]> text_encoder_cnn_0_0_bias_to_fp16 = const()[name = string("text_encoder_cnn_0_0_bias_to_fp16"), val = tensor<fp16, [512]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(2803904)))]; |
| tensor<fp16, [1, 512, ?]> x_5_cast_fp16 = conv(bias = text_encoder_cnn_0_0_bias_to_fp16, dilations = x_5_dilations_0, groups = x_5_groups_0, pad = x_5_pad_0, pad_type = x_5_pad_type_0, strides = x_5_strides_0, weight = weight_3_to_fp16, x = input_1_cast_fp16)[name = string("x_5_cast_fp16")]; |
| tensor<int32, [3]> input_3_perm_0 = const()[name = string("input_3_perm_0"), val = tensor<int32, [3]>([0, -1, 1])]; |
| tensor<int32, [1]> x_7_axes_0 = const()[name = string("x_7_axes_0"), val = tensor<int32, [1]>([-1])]; |
| tensor<fp16, [512]> text_encoder_cnn_0_1_gamma_to_fp16 = const()[name = string("text_encoder_cnn_0_1_gamma_to_fp16"), val = tensor<fp16, [512]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(2804992)))]; |
| tensor<fp16, [512]> text_encoder_cnn_0_1_beta_to_fp16 = const()[name = string("text_encoder_cnn_0_1_beta_to_fp16"), val = tensor<fp16, [512]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(2806080)))]; |
| fp16 var_38_to_fp16 = const()[name = string("op_38_to_fp16"), val = fp16(0x1.5p-17)]; |
| tensor<fp16, [1, ?, 512]> input_3_cast_fp16 = transpose(perm = input_3_perm_0, x = x_5_cast_fp16)[name = string("transpose_9")]; |
| tensor<fp16, [1, ?, 512]> x_7_cast_fp16 = layer_norm(axes = x_7_axes_0, beta = text_encoder_cnn_0_1_beta_to_fp16, epsilon = var_38_to_fp16, gamma = text_encoder_cnn_0_1_gamma_to_fp16, x = input_3_cast_fp16)[name = string("x_7_cast_fp16")]; |
| tensor<int32, [3]> input_5_perm_0 = const()[name = string("input_5_perm_0"), val = tensor<int32, [3]>([0, -1, 1])]; |
| tensor<fp16, [1, 512, ?]> input_5_cast_fp16 = transpose(perm = input_5_perm_0, x = x_7_cast_fp16)[name = string("transpose_8")]; |
| tensor<fp16, [1, 512, ?]> x_9_cast_fp16 = leaky_relu(alpha = var_35, x = input_5_cast_fp16)[name = string("x_9_cast_fp16")]; |
| tensor<fp16, [1, 512, ?]> input_7_cast_fp16 = mul(x = x_9_cast_fp16, y = keep_cast_fp16)[name = string("input_7_cast_fp16")]; |
| fp32 var_65 = const()[name = string("op_65"), val = fp32(0x1.99999ap-3)]; |
| string x_11_pad_type_0 = const()[name = string("x_11_pad_type_0"), val = string("custom")]; |
| tensor<int32, [2]> x_11_pad_0 = const()[name = string("x_11_pad_0"), val = tensor<int32, [2]>([2, 2])]; |
| tensor<int32, [1]> x_11_strides_0 = const()[name = string("x_11_strides_0"), val = tensor<int32, [1]>([1])]; |
| tensor<int32, [1]> x_11_dilations_0 = const()[name = string("x_11_dilations_0"), val = tensor<int32, [1]>([1])]; |
| int32 x_11_groups_0 = const()[name = string("x_11_groups_0"), val = int32(1)]; |
| tensor<fp16, [512, 512, 5]> weight_7_to_fp16 = const()[name = string("weight_7_to_fp16"), val = tensor<fp16, [512, 512, 5]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(2807168)))]; |
| tensor<fp16, [512]> text_encoder_cnn_1_0_bias_to_fp16 = const()[name = string("text_encoder_cnn_1_0_bias_to_fp16"), val = tensor<fp16, [512]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(5428672)))]; |
| tensor<fp16, [1, 512, ?]> x_11_cast_fp16 = conv(bias = text_encoder_cnn_1_0_bias_to_fp16, dilations = x_11_dilations_0, groups = x_11_groups_0, pad = x_11_pad_0, pad_type = x_11_pad_type_0, strides = x_11_strides_0, weight = weight_7_to_fp16, x = input_7_cast_fp16)[name = string("x_11_cast_fp16")]; |
| tensor<int32, [3]> input_9_perm_0 = const()[name = string("input_9_perm_0"), val = tensor<int32, [3]>([0, -1, 1])]; |
| tensor<int32, [1]> x_13_axes_0 = const()[name = string("x_13_axes_0"), val = tensor<int32, [1]>([-1])]; |
| tensor<fp16, [512]> text_encoder_cnn_1_1_gamma_to_fp16 = const()[name = string("text_encoder_cnn_1_1_gamma_to_fp16"), val = tensor<fp16, [512]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(5429760)))]; |
| tensor<fp16, [512]> text_encoder_cnn_1_1_beta_to_fp16 = const()[name = string("text_encoder_cnn_1_1_beta_to_fp16"), val = tensor<fp16, [512]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(5430848)))]; |
| fp16 var_68_to_fp16 = const()[name = string("op_68_to_fp16"), val = fp16(0x1.5p-17)]; |
| tensor<fp16, [1, ?, 512]> input_9_cast_fp16 = transpose(perm = input_9_perm_0, x = x_11_cast_fp16)[name = string("transpose_7")]; |
| tensor<fp16, [1, ?, 512]> x_13_cast_fp16 = layer_norm(axes = x_13_axes_0, beta = text_encoder_cnn_1_1_beta_to_fp16, epsilon = var_68_to_fp16, gamma = text_encoder_cnn_1_1_gamma_to_fp16, x = input_9_cast_fp16)[name = string("x_13_cast_fp16")]; |
| tensor<int32, [3]> input_11_perm_0 = const()[name = string("input_11_perm_0"), val = tensor<int32, [3]>([0, -1, 1])]; |
| tensor<fp16, [1, 512, ?]> input_11_cast_fp16 = transpose(perm = input_11_perm_0, x = x_13_cast_fp16)[name = string("transpose_6")]; |
| tensor<fp16, [1, 512, ?]> x_15_cast_fp16 = leaky_relu(alpha = var_65, x = input_11_cast_fp16)[name = string("x_15_cast_fp16")]; |
| tensor<fp16, [1, 512, ?]> input_13_cast_fp16 = mul(x = x_15_cast_fp16, y = keep_cast_fp16)[name = string("input_13_cast_fp16")]; |
| fp32 var_95 = const()[name = string("op_95"), val = fp32(0x1.99999ap-3)]; |
| string x_17_pad_type_0 = const()[name = string("x_17_pad_type_0"), val = string("custom")]; |
| tensor<int32, [2]> x_17_pad_0 = const()[name = string("x_17_pad_0"), val = tensor<int32, [2]>([2, 2])]; |
| tensor<int32, [1]> x_17_strides_0 = const()[name = string("x_17_strides_0"), val = tensor<int32, [1]>([1])]; |
| tensor<int32, [1]> x_17_dilations_0 = const()[name = string("x_17_dilations_0"), val = tensor<int32, [1]>([1])]; |
| int32 x_17_groups_0 = const()[name = string("x_17_groups_0"), val = int32(1)]; |
| tensor<fp16, [512, 512, 5]> weight_11_to_fp16 = const()[name = string("weight_11_to_fp16"), val = tensor<fp16, [512, 512, 5]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(5431936)))]; |
| tensor<fp16, [512]> text_encoder_cnn_2_0_bias_to_fp16 = const()[name = string("text_encoder_cnn_2_0_bias_to_fp16"), val = tensor<fp16, [512]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(8053440)))]; |
| tensor<fp16, [1, 512, ?]> x_17_cast_fp16 = conv(bias = text_encoder_cnn_2_0_bias_to_fp16, dilations = x_17_dilations_0, groups = x_17_groups_0, pad = x_17_pad_0, pad_type = x_17_pad_type_0, strides = x_17_strides_0, weight = weight_11_to_fp16, x = input_13_cast_fp16)[name = string("x_17_cast_fp16")]; |
| tensor<int32, [3]> input_15_perm_0 = const()[name = string("input_15_perm_0"), val = tensor<int32, [3]>([0, -1, 1])]; |
| tensor<int32, [1]> x_19_axes_0 = const()[name = string("x_19_axes_0"), val = tensor<int32, [1]>([-1])]; |
| tensor<fp16, [512]> text_encoder_cnn_2_1_gamma_to_fp16 = const()[name = string("text_encoder_cnn_2_1_gamma_to_fp16"), val = tensor<fp16, [512]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(8054528)))]; |
| tensor<fp16, [512]> text_encoder_cnn_2_1_beta_to_fp16 = const()[name = string("text_encoder_cnn_2_1_beta_to_fp16"), val = tensor<fp16, [512]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(8055616)))]; |
| fp16 var_98_to_fp16 = const()[name = string("op_98_to_fp16"), val = fp16(0x1.5p-17)]; |
| tensor<fp16, [1, ?, 512]> input_15_cast_fp16 = transpose(perm = input_15_perm_0, x = x_17_cast_fp16)[name = string("transpose_5")]; |
| tensor<fp16, [1, ?, 512]> x_19_cast_fp16 = layer_norm(axes = x_19_axes_0, beta = text_encoder_cnn_2_1_beta_to_fp16, epsilon = var_98_to_fp16, gamma = text_encoder_cnn_2_1_gamma_to_fp16, x = input_15_cast_fp16)[name = string("x_19_cast_fp16")]; |
| tensor<int32, [3]> input_17_perm_0 = const()[name = string("input_17_perm_0"), val = tensor<int32, [3]>([0, -1, 1])]; |
| tensor<fp16, [1, 512, ?]> input_17_cast_fp16 = transpose(perm = input_17_perm_0, x = x_19_cast_fp16)[name = string("transpose_4")]; |
| tensor<fp16, [1, 512, ?]> x_21_cast_fp16 = leaky_relu(alpha = var_95, x = input_17_cast_fp16)[name = string("x_21_cast_fp16")]; |
| tensor<fp16, [1, 512, ?]> x_23_cast_fp16 = mul(x = x_21_cast_fp16, y = keep_cast_fp16)[name = string("x_23_cast_fp16")]; |
| tensor<int32, [3]> transpose_0_perm_0 = const()[name = string("transpose_0_perm_0"), val = tensor<int32, [3]>([2, 0, 1])]; |
| string x_25_batch_first_direction_0 = const()[name = string("x_25_batch_first_direction_0"), val = string("bidirectional")]; |
| bool x_25_batch_first_output_sequence_0 = const()[name = string("x_25_batch_first_output_sequence_0"), val = bool(true)]; |
| string x_25_batch_first_recurrent_activation_0 = const()[name = string("x_25_batch_first_recurrent_activation_0"), val = string("sigmoid")]; |
| string x_25_batch_first_cell_activation_0 = const()[name = string("x_25_batch_first_cell_activation_0"), val = string("tanh")]; |
| string x_25_batch_first_activation_0 = const()[name = string("x_25_batch_first_activation_0"), val = string("tanh")]; |
| tensor<fp16, [1, 512]> x_25_batch_first_lstm_h0_reshaped_to_fp16 = const()[name = string("x_25_batch_first_lstm_h0_reshaped_to_fp16"), val = tensor<fp16, [1, 512]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(8056704)))]; |
| tensor<fp16, [1024, 512]> concat_4_to_fp16 = const()[name = string("concat_4_to_fp16"), val = tensor<fp16, [1024, 512]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(8057792)))]; |
| tensor<fp16, [1024, 256]> concat_5_to_fp16 = const()[name = string("concat_5_to_fp16"), val = tensor<fp16, [1024, 256]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(9106432)))]; |
| tensor<fp16, [1024]> add_0_to_fp16 = const()[name = string("add_0_to_fp16"), val = tensor<fp16, [1024]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(9630784)))]; |
| tensor<fp16, [1024, 512]> concat_6_to_fp16 = const()[name = string("concat_6_to_fp16"), val = tensor<fp16, [1024, 512]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(9632896)))]; |
| tensor<fp16, [1024, 256]> concat_7_to_fp16 = const()[name = string("concat_7_to_fp16"), val = tensor<fp16, [1024, 256]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(10681536)))]; |
| tensor<fp16, [1024]> add_1_to_fp16 = const()[name = string("add_1_to_fp16"), val = tensor<fp16, [1024]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(11205888)))]; |
| tensor<fp16, [?, 1, 512]> transpose_0_cast_fp16 = transpose(perm = transpose_0_perm_0, x = x_23_cast_fp16)[name = string("transpose_3")]; |
| tensor<fp16, [?, 1, 512]> x_25_batch_first_cast_fp16_0, tensor<fp16, [1, 512]> x_25_batch_first_cast_fp16_1, tensor<fp16, [1, 512]> x_25_batch_first_cast_fp16_2 = lstm(activation = x_25_batch_first_activation_0, bias = add_0_to_fp16, bias_back = add_1_to_fp16, cell_activation = x_25_batch_first_cell_activation_0, direction = x_25_batch_first_direction_0, initial_c = x_25_batch_first_lstm_h0_reshaped_to_fp16, initial_h = x_25_batch_first_lstm_h0_reshaped_to_fp16, output_sequence = x_25_batch_first_output_sequence_0, recurrent_activation = x_25_batch_first_recurrent_activation_0, weight_hh = concat_5_to_fp16, weight_hh_back = concat_7_to_fp16, weight_ih = concat_4_to_fp16, weight_ih_back = concat_6_to_fp16, x = transpose_0_cast_fp16)[name = string("x_25_batch_first_cast_fp16")]; |
| tensor<int32, [3]> transpose_1_perm_0 = const()[name = string("transpose_1_perm_0"), val = tensor<int32, [3]>([1, 2, 0])]; |
| tensor<fp16, [1, 512, ?]> transpose_1_cast_fp16 = transpose(perm = transpose_1_perm_0, x = x_25_batch_first_cast_fp16_0)[name = string("transpose_2")]; |
| tensor<fp16, [1, 512, ?]> var_159 = mul(x = transpose_1_cast_fp16, y = keep_cast_fp16)[name = string("op_159_cast_fp16")]; |
| tensor<int32, [1]> input_lengths_tmp = identity(x = input_lengths)[name = string("input_lengths_tmp")]; |
| } -> (var_159); |
| } |