File size: 11,543 Bytes
fc7dbb4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
program(1.3)
[buildInfo = dict<string, string>({{"coremlc-component-MIL", "3520.4.1"}, {"coremlc-version", "3520.5.1"}, {"coremltools-component-torch", "2.14.0"}, {"coremltools-source-dialect", "TorchScript"}, {"coremltools-version", "9.0"}})]
{
    func main<ios18>(tensor<fp32, [2, 1, 640]> c_in, tensor<fp32, [2, 1, 640]> h_in, tensor<int32, [1, 1]> targets) {
            int32 input_batch_dims_0 = const()[name = string("input_batch_dims_0"), val = int32(0)];
            bool input_validate_indices_0 = const()[name = string("input_validate_indices_0"), val = bool(false)];
            tensor<fp16, [8193, 640]> d_embedding_weight_to_fp16 = const()[name = string("d_embedding_weight_to_fp16"), val = tensor<fp16, [8193, 640]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(64)))];
            string targets_to_int16_dtype_0 = const()[name = string("targets_to_int16_dtype_0"), val = string("int16")];
            string cast_1_dtype_0 = const()[name = string("cast_1_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, 1]> targets_to_int16 = cast(dtype = targets_to_int16_dtype_0, x = targets)[name = string("cast_9")];
            tensor<int32, [1, 1]> cast_1 = cast(dtype = cast_1_dtype_0, x = targets_to_int16)[name = string("cast_8")];
            tensor<bool, [1, 1]> greater_equal_0 = greater_equal(x = cast_1, 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(8193)];
            tensor<int32, [1, 1]> add_2 = add(x = cast_1, y = slice_by_index_0)[name = string("add_2")];
            tensor<int32, [1, 1]> select_0 = select(a = cast_1, b = add_2, cond = greater_equal_0)[name = string("select_0")];
            int32 input_cast_fp16_cast_uint16_axis_0 = const()[name = string("input_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, 1]> select_0_to_int16 = cast(dtype = select_0_to_int16_dtype_0, x = select_0)[name = string("cast_7")];
            tensor<fp16, [1, 1, 640]> input_cast_fp16_cast_uint16_cast_uint16 = gather(axis = input_cast_fp16_cast_uint16_axis_0, batch_dims = input_batch_dims_0, indices = select_0_to_int16, validate_indices = input_validate_indices_0, x = d_embedding_weight_to_fp16)[name = string("input_cast_fp16_cast_uint16_cast_uint16")];
            tensor<int32, [3]> input_batch_first_transpose_perm_0 = const()[name = string("input_batch_first_transpose_perm_0"), val = tensor<int32, [3]>([1, 0, 2])];
            int32 split_0_num_splits_0 = const()[name = string("split_0_num_splits_0"), val = int32(2)];
            int32 split_0_axis_0 = const()[name = string("split_0_axis_0"), val = int32(0)];
            string h_in_to_fp16_dtype_0 = const()[name = string("h_in_to_fp16_dtype_0"), val = string("fp16")];
            tensor<fp16, [2, 1, 640]> h_in_to_fp16 = cast(dtype = h_in_to_fp16_dtype_0, x = h_in)[name = string("cast_6")];
            tensor<fp16, [1, 1, 640]> split_0_cast_fp16_0, tensor<fp16, [1, 1, 640]> split_0_cast_fp16_1 = split(axis = split_0_axis_0, num_splits = split_0_num_splits_0, x = h_in_to_fp16)[name = string("split_0_cast_fp16")];
            int32 split_1_num_splits_0 = const()[name = string("split_1_num_splits_0"), val = int32(2)];
            int32 split_1_axis_0 = const()[name = string("split_1_axis_0"), val = int32(0)];
            string c_in_to_fp16_dtype_0 = const()[name = string("c_in_to_fp16_dtype_0"), val = string("fp16")];
            tensor<fp16, [2, 1, 640]> c_in_to_fp16 = cast(dtype = c_in_to_fp16_dtype_0, x = c_in)[name = string("cast_5")];
            tensor<fp16, [1, 1, 640]> split_1_cast_fp16_0, tensor<fp16, [1, 1, 640]> split_1_cast_fp16_1 = split(axis = split_1_axis_0, num_splits = split_1_num_splits_0, x = c_in_to_fp16)[name = string("split_1_cast_fp16")];
            tensor<int32, [1]> o_lstm_layer_0_lstm_h0_squeeze_axes_0 = const()[name = string("o_lstm_layer_0_lstm_h0_squeeze_axes_0"), val = tensor<int32, [1]>([0])];
            tensor<fp16, [1, 640]> o_lstm_layer_0_lstm_h0_squeeze_cast_fp16 = squeeze(axes = o_lstm_layer_0_lstm_h0_squeeze_axes_0, x = split_0_cast_fp16_0)[name = string("o_lstm_layer_0_lstm_h0_squeeze_cast_fp16")];
            tensor<int32, [1]> o_lstm_layer_0_lstm_c0_squeeze_axes_0 = const()[name = string("o_lstm_layer_0_lstm_c0_squeeze_axes_0"), val = tensor<int32, [1]>([0])];
            tensor<fp16, [1, 640]> o_lstm_layer_0_lstm_c0_squeeze_cast_fp16 = squeeze(axes = o_lstm_layer_0_lstm_c0_squeeze_axes_0, x = split_1_cast_fp16_0)[name = string("o_lstm_layer_0_lstm_c0_squeeze_cast_fp16")];
            string o_lstm_layer_0_direction_0 = const()[name = string("o_lstm_layer_0_direction_0"), val = string("forward")];
            bool o_lstm_layer_0_output_sequence_0 = const()[name = string("o_lstm_layer_0_output_sequence_0"), val = bool(true)];
            string o_lstm_layer_0_recurrent_activation_0 = const()[name = string("o_lstm_layer_0_recurrent_activation_0"), val = string("sigmoid")];
            string o_lstm_layer_0_cell_activation_0 = const()[name = string("o_lstm_layer_0_cell_activation_0"), val = string("tanh")];
            string o_lstm_layer_0_activation_0 = const()[name = string("o_lstm_layer_0_activation_0"), val = string("tanh")];
            tensor<fp16, [2560, 640]> concat_1_to_fp16 = const()[name = string("concat_1_to_fp16"), val = tensor<fp16, [2560, 640]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(10487168)))];
            tensor<fp16, [2560, 640]> concat_2_to_fp16 = const()[name = string("concat_2_to_fp16"), val = tensor<fp16, [2560, 640]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(13764032)))];
            tensor<fp16, [2560]> concat_0_to_fp16 = const()[name = string("concat_0_to_fp16"), val = tensor<fp16, [2560]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(17040896)))];
            tensor<fp16, [1, 1, 640]> input_batch_first_transpose_cast_fp16 = transpose(perm = input_batch_first_transpose_perm_0, x = input_cast_fp16_cast_uint16_cast_uint16)[name = string("transpose_2")];
            tensor<fp16, [1, 1, 640]> o_lstm_layer_0_cast_fp16_0, tensor<fp16, [1, 640]> o_lstm_layer_0_cast_fp16_1, tensor<fp16, [1, 640]> o_lstm_layer_0_cast_fp16_2 = lstm(activation = o_lstm_layer_0_activation_0, bias = concat_0_to_fp16, cell_activation = o_lstm_layer_0_cell_activation_0, direction = o_lstm_layer_0_direction_0, initial_c = o_lstm_layer_0_lstm_c0_squeeze_cast_fp16, initial_h = o_lstm_layer_0_lstm_h0_squeeze_cast_fp16, output_sequence = o_lstm_layer_0_output_sequence_0, recurrent_activation = o_lstm_layer_0_recurrent_activation_0, weight_hh = concat_2_to_fp16, weight_ih = concat_1_to_fp16, x = input_batch_first_transpose_cast_fp16)[name = string("o_lstm_layer_0_cast_fp16")];
            tensor<int32, [1]> o_batch_first_lstm_h0_squeeze_axes_0 = const()[name = string("o_batch_first_lstm_h0_squeeze_axes_0"), val = tensor<int32, [1]>([0])];
            tensor<fp16, [1, 640]> o_batch_first_lstm_h0_squeeze_cast_fp16 = squeeze(axes = o_batch_first_lstm_h0_squeeze_axes_0, x = split_0_cast_fp16_1)[name = string("o_batch_first_lstm_h0_squeeze_cast_fp16")];
            tensor<int32, [1]> o_batch_first_lstm_c0_squeeze_axes_0 = const()[name = string("o_batch_first_lstm_c0_squeeze_axes_0"), val = tensor<int32, [1]>([0])];
            tensor<fp16, [1, 640]> o_batch_first_lstm_c0_squeeze_cast_fp16 = squeeze(axes = o_batch_first_lstm_c0_squeeze_axes_0, x = split_1_cast_fp16_1)[name = string("o_batch_first_lstm_c0_squeeze_cast_fp16")];
            string o_batch_first_direction_0 = const()[name = string("o_batch_first_direction_0"), val = string("forward")];
            bool o_batch_first_output_sequence_0 = const()[name = string("o_batch_first_output_sequence_0"), val = bool(true)];
            string o_batch_first_recurrent_activation_0 = const()[name = string("o_batch_first_recurrent_activation_0"), val = string("sigmoid")];
            string o_batch_first_cell_activation_0 = const()[name = string("o_batch_first_cell_activation_0"), val = string("tanh")];
            string o_batch_first_activation_0 = const()[name = string("o_batch_first_activation_0"), val = string("tanh")];
            tensor<fp16, [2560, 640]> concat_4_to_fp16 = const()[name = string("concat_4_to_fp16"), val = tensor<fp16, [2560, 640]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(17046080)))];
            tensor<fp16, [2560, 640]> concat_5_to_fp16 = const()[name = string("concat_5_to_fp16"), val = tensor<fp16, [2560, 640]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(20322944)))];
            tensor<fp16, [2560]> concat_3_to_fp16 = const()[name = string("concat_3_to_fp16"), val = tensor<fp16, [2560]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(23599808)))];
            tensor<fp16, [1, 1, 640]> o_batch_first_cast_fp16_0, tensor<fp16, [1, 640]> o_batch_first_cast_fp16_1, tensor<fp16, [1, 640]> o_batch_first_cast_fp16_2 = lstm(activation = o_batch_first_activation_0, bias = concat_3_to_fp16, cell_activation = o_batch_first_cell_activation_0, direction = o_batch_first_direction_0, initial_c = o_batch_first_lstm_c0_squeeze_cast_fp16, initial_h = o_batch_first_lstm_h0_squeeze_cast_fp16, output_sequence = o_batch_first_output_sequence_0, recurrent_activation = o_batch_first_recurrent_activation_0, weight_hh = concat_5_to_fp16, weight_ih = concat_4_to_fp16, x = o_lstm_layer_0_cast_fp16_0)[name = string("o_batch_first_cast_fp16")];
            tensor<int32, [3]> transpose_0_perm_0 = const()[name = string("transpose_0_perm_0"), val = tensor<int32, [3]>([1, 2, 0])];
            string transpose_0_cast_fp16_to_fp32_dtype_0 = const()[name = string("transpose_0_cast_fp16_to_fp32_dtype_0"), val = string("fp32")];
            int32 var_32_axis_0 = const()[name = string("op_32_axis_0"), val = int32(0)];
            tensor<fp16, [2, 1, 640]> var_32_cast_fp16 = stack(axis = var_32_axis_0, values = (o_lstm_layer_0_cast_fp16_1, o_batch_first_cast_fp16_1))[name = string("op_32_cast_fp16")];
            string var_32_cast_fp16_to_fp32_dtype_0 = const()[name = string("op_32_cast_fp16_to_fp32_dtype_0"), val = string("fp32")];
            int32 var_33_axis_0 = const()[name = string("op_33_axis_0"), val = int32(0)];
            tensor<fp16, [2, 1, 640]> var_33_cast_fp16 = stack(axis = var_33_axis_0, values = (o_lstm_layer_0_cast_fp16_2, o_batch_first_cast_fp16_2))[name = string("op_33_cast_fp16")];
            string var_33_cast_fp16_to_fp32_dtype_0 = const()[name = string("op_33_cast_fp16_to_fp32_dtype_0"), val = string("fp32")];
            tensor<fp32, [2, 1, 640]> c_out = cast(dtype = var_33_cast_fp16_to_fp32_dtype_0, x = var_33_cast_fp16)[name = string("cast_2")];
            tensor<fp32, [2, 1, 640]> h_out = cast(dtype = var_32_cast_fp16_to_fp32_dtype_0, x = var_32_cast_fp16)[name = string("cast_3")];
            tensor<fp16, [1, 640, 1]> transpose_0_cast_fp16 = transpose(perm = transpose_0_perm_0, x = o_batch_first_cast_fp16_0)[name = string("transpose_1")];
            tensor<fp32, [1, 640, 1]> decoder = cast(dtype = transpose_0_cast_fp16_to_fp32_dtype_0, x = transpose_0_cast_fp16)[name = string("cast_4")];
        } -> (decoder, h_out, c_out);
}