Automatic Speech Recognition
Core ML
NeMo
apple-neural-engine
on-device
ios
macos
speech
audio
automatic-speech-translation
canary
fastconformer
kv-cache
fp16
Instructions to use smdesai/canary-1b-v2-coreml with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- NeMo
How to use smdesai/canary-1b-v2-coreml with NeMo:
import nemo.collections.asr as nemo_asr asr_model = nemo_asr.models.ASRModel.from_pretrained("smdesai/canary-1b-v2-coreml") transcriptions = asr_model.transcribe(["file.wav"]) - Notebooks
- Google Colab
- Kaggle
| program(1.3) | |
| [buildInfo = dict<string, string>({{"coremlc-component-MIL", "3600.16.1"}, {"coremlc-version", "3600.22.1"}, {"coremltools-component-torch", "2.7.0"}, {"coremltools-source-dialect", "TorchScript"}, {"coremltools-version", "9.0b1"}})] | |
| { | |
| func main<ios18>(tensor<fp32, [1, 188, 1024]> enc_states) { | |
| string enc_states_to_fp16_dtype_0 = const()[name = string("enc_states_to_fp16_dtype_0"), val = string("fp16")]; | |
| tensor<fp16, [1024, 1024]> layers_0_second_sub_layer_key_net_weight_to_fp16 = const()[name = string("layers_0_second_sub_layer_key_net_weight_to_fp16"), val = tensor<fp16, [1024, 1024]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(64)))]; | |
| tensor<fp16, [1024]> layers_0_second_sub_layer_key_net_bias_to_fp16 = const()[name = string("layers_0_second_sub_layer_key_net_bias_to_fp16"), val = tensor<fp16, [1024]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(2097280)))]; | |
| tensor<fp16, [1, 188, 1024]> enc_states_to_fp16 = cast(dtype = enc_states_to_fp16_dtype_0, x = enc_states)[name = string("cast_34")]; | |
| tensor<fp16, [1, 188, 1024]> linear_0_cast_fp16 = linear(bias = layers_0_second_sub_layer_key_net_bias_to_fp16, weight = layers_0_second_sub_layer_key_net_weight_to_fp16, x = enc_states_to_fp16)[name = string("linear_0_cast_fp16")]; | |
| tensor<int32, [4]> var_79 = const()[name = string("op_79"), val = tensor<int32, [4]>([1, 188, 8, 128])]; | |
| tensor<fp16, [1, 188, 8, 128]> var_80_cast_fp16 = reshape(shape = var_79, x = linear_0_cast_fp16)[name = string("op_80_cast_fp16")]; | |
| tensor<fp16, [1024, 1024]> layers_0_second_sub_layer_value_net_weight_to_fp16 = const()[name = string("layers_0_second_sub_layer_value_net_weight_to_fp16"), val = tensor<fp16, [1024, 1024]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(2099392)))]; | |
| tensor<fp16, [1024]> layers_0_second_sub_layer_value_net_bias_to_fp16 = const()[name = string("layers_0_second_sub_layer_value_net_bias_to_fp16"), val = tensor<fp16, [1024]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(4196608)))]; | |
| tensor<fp16, [1, 188, 1024]> linear_1_cast_fp16 = linear(bias = layers_0_second_sub_layer_value_net_bias_to_fp16, weight = layers_0_second_sub_layer_value_net_weight_to_fp16, x = enc_states_to_fp16)[name = string("linear_1_cast_fp16")]; | |
| tensor<int32, [4]> var_100 = const()[name = string("op_100"), val = tensor<int32, [4]>([1, 188, 8, 128])]; | |
| tensor<fp16, [1, 188, 8, 128]> var_101_cast_fp16 = reshape(shape = var_100, x = linear_1_cast_fp16)[name = string("op_101_cast_fp16")]; | |
| fp16 _inversed_109_y_0_to_fp16 = const()[name = string("_inversed_109_y_0_to_fp16"), val = fp16(0x1.308p-2)]; | |
| tensor<fp16, [1, 188, 8, 128]> _inversed_109_cast_fp16 = mul(x = var_80_cast_fp16, y = _inversed_109_y_0_to_fp16)[name = string("_inversed_109_cast_fp16")]; | |
| tensor<fp16, [1024, 1024]> layers_1_second_sub_layer_key_net_weight_to_fp16 = const()[name = string("layers_1_second_sub_layer_key_net_weight_to_fp16"), val = tensor<fp16, [1024, 1024]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(4198720)))]; | |
| tensor<fp16, [1024]> layers_1_second_sub_layer_key_net_bias_to_fp16 = const()[name = string("layers_1_second_sub_layer_key_net_bias_to_fp16"), val = tensor<fp16, [1024]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(6295936)))]; | |
| tensor<fp16, [1, 188, 1024]> linear_2_cast_fp16 = linear(bias = layers_1_second_sub_layer_key_net_bias_to_fp16, weight = layers_1_second_sub_layer_key_net_weight_to_fp16, x = enc_states_to_fp16)[name = string("linear_2_cast_fp16")]; | |
| tensor<int32, [4]> var_123 = const()[name = string("op_123"), val = tensor<int32, [4]>([1, 188, 8, 128])]; | |
| tensor<fp16, [1, 188, 8, 128]> var_124_cast_fp16 = reshape(shape = var_123, x = linear_2_cast_fp16)[name = string("op_124_cast_fp16")]; | |
| tensor<fp16, [1024, 1024]> layers_1_second_sub_layer_value_net_weight_to_fp16 = const()[name = string("layers_1_second_sub_layer_value_net_weight_to_fp16"), val = tensor<fp16, [1024, 1024]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(6298048)))]; | |
| tensor<fp16, [1024]> layers_1_second_sub_layer_value_net_bias_to_fp16 = const()[name = string("layers_1_second_sub_layer_value_net_bias_to_fp16"), val = tensor<fp16, [1024]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(8395264)))]; | |
| tensor<fp16, [1, 188, 1024]> linear_3_cast_fp16 = linear(bias = layers_1_second_sub_layer_value_net_bias_to_fp16, weight = layers_1_second_sub_layer_value_net_weight_to_fp16, x = enc_states_to_fp16)[name = string("linear_3_cast_fp16")]; | |
| tensor<int32, [4]> var_144 = const()[name = string("op_144"), val = tensor<int32, [4]>([1, 188, 8, 128])]; | |
| tensor<fp16, [1, 188, 8, 128]> var_145_cast_fp16 = reshape(shape = var_144, x = linear_3_cast_fp16)[name = string("op_145_cast_fp16")]; | |
| fp16 _inversed_153_y_0_to_fp16 = const()[name = string("_inversed_153_y_0_to_fp16"), val = fp16(0x1.308p-2)]; | |
| tensor<fp16, [1, 188, 8, 128]> _inversed_153_cast_fp16 = mul(x = var_124_cast_fp16, y = _inversed_153_y_0_to_fp16)[name = string("_inversed_153_cast_fp16")]; | |
| tensor<fp16, [1024, 1024]> layers_2_second_sub_layer_key_net_weight_to_fp16 = const()[name = string("layers_2_second_sub_layer_key_net_weight_to_fp16"), val = tensor<fp16, [1024, 1024]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(8397376)))]; | |
| tensor<fp16, [1024]> layers_2_second_sub_layer_key_net_bias_to_fp16 = const()[name = string("layers_2_second_sub_layer_key_net_bias_to_fp16"), val = tensor<fp16, [1024]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(10494592)))]; | |
| tensor<fp16, [1, 188, 1024]> linear_4_cast_fp16 = linear(bias = layers_2_second_sub_layer_key_net_bias_to_fp16, weight = layers_2_second_sub_layer_key_net_weight_to_fp16, x = enc_states_to_fp16)[name = string("linear_4_cast_fp16")]; | |
| tensor<int32, [4]> var_167 = const()[name = string("op_167"), val = tensor<int32, [4]>([1, 188, 8, 128])]; | |
| tensor<fp16, [1, 188, 8, 128]> var_168_cast_fp16 = reshape(shape = var_167, x = linear_4_cast_fp16)[name = string("op_168_cast_fp16")]; | |
| tensor<fp16, [1024, 1024]> layers_2_second_sub_layer_value_net_weight_to_fp16 = const()[name = string("layers_2_second_sub_layer_value_net_weight_to_fp16"), val = tensor<fp16, [1024, 1024]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(10496704)))]; | |
| tensor<fp16, [1024]> layers_2_second_sub_layer_value_net_bias_to_fp16 = const()[name = string("layers_2_second_sub_layer_value_net_bias_to_fp16"), val = tensor<fp16, [1024]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(12593920)))]; | |
| tensor<fp16, [1, 188, 1024]> linear_5_cast_fp16 = linear(bias = layers_2_second_sub_layer_value_net_bias_to_fp16, weight = layers_2_second_sub_layer_value_net_weight_to_fp16, x = enc_states_to_fp16)[name = string("linear_5_cast_fp16")]; | |
| tensor<int32, [4]> var_188 = const()[name = string("op_188"), val = tensor<int32, [4]>([1, 188, 8, 128])]; | |
| tensor<fp16, [1, 188, 8, 128]> var_189_cast_fp16 = reshape(shape = var_188, x = linear_5_cast_fp16)[name = string("op_189_cast_fp16")]; | |
| fp16 _inversed_197_y_0_to_fp16 = const()[name = string("_inversed_197_y_0_to_fp16"), val = fp16(0x1.308p-2)]; | |
| tensor<fp16, [1, 188, 8, 128]> _inversed_197_cast_fp16 = mul(x = var_168_cast_fp16, y = _inversed_197_y_0_to_fp16)[name = string("_inversed_197_cast_fp16")]; | |
| tensor<fp16, [1024, 1024]> layers_3_second_sub_layer_key_net_weight_to_fp16 = const()[name = string("layers_3_second_sub_layer_key_net_weight_to_fp16"), val = tensor<fp16, [1024, 1024]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(12596032)))]; | |
| tensor<fp16, [1024]> layers_3_second_sub_layer_key_net_bias_to_fp16 = const()[name = string("layers_3_second_sub_layer_key_net_bias_to_fp16"), val = tensor<fp16, [1024]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(14693248)))]; | |
| tensor<fp16, [1, 188, 1024]> linear_6_cast_fp16 = linear(bias = layers_3_second_sub_layer_key_net_bias_to_fp16, weight = layers_3_second_sub_layer_key_net_weight_to_fp16, x = enc_states_to_fp16)[name = string("linear_6_cast_fp16")]; | |
| tensor<int32, [4]> var_211 = const()[name = string("op_211"), val = tensor<int32, [4]>([1, 188, 8, 128])]; | |
| tensor<fp16, [1, 188, 8, 128]> var_212_cast_fp16 = reshape(shape = var_211, x = linear_6_cast_fp16)[name = string("op_212_cast_fp16")]; | |
| tensor<fp16, [1024, 1024]> layers_3_second_sub_layer_value_net_weight_to_fp16 = const()[name = string("layers_3_second_sub_layer_value_net_weight_to_fp16"), val = tensor<fp16, [1024, 1024]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(14695360)))]; | |
| tensor<fp16, [1024]> layers_3_second_sub_layer_value_net_bias_to_fp16 = const()[name = string("layers_3_second_sub_layer_value_net_bias_to_fp16"), val = tensor<fp16, [1024]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(16792576)))]; | |
| tensor<fp16, [1, 188, 1024]> linear_7_cast_fp16 = linear(bias = layers_3_second_sub_layer_value_net_bias_to_fp16, weight = layers_3_second_sub_layer_value_net_weight_to_fp16, x = enc_states_to_fp16)[name = string("linear_7_cast_fp16")]; | |
| tensor<int32, [4]> var_232 = const()[name = string("op_232"), val = tensor<int32, [4]>([1, 188, 8, 128])]; | |
| tensor<fp16, [1, 188, 8, 128]> var_233_cast_fp16 = reshape(shape = var_232, x = linear_7_cast_fp16)[name = string("op_233_cast_fp16")]; | |
| fp16 _inversed_241_y_0_to_fp16 = const()[name = string("_inversed_241_y_0_to_fp16"), val = fp16(0x1.308p-2)]; | |
| tensor<fp16, [1, 188, 8, 128]> _inversed_241_cast_fp16 = mul(x = var_212_cast_fp16, y = _inversed_241_y_0_to_fp16)[name = string("_inversed_241_cast_fp16")]; | |
| tensor<fp16, [1024, 1024]> layers_4_second_sub_layer_key_net_weight_to_fp16 = const()[name = string("layers_4_second_sub_layer_key_net_weight_to_fp16"), val = tensor<fp16, [1024, 1024]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(16794688)))]; | |
| tensor<fp16, [1024]> layers_4_second_sub_layer_key_net_bias_to_fp16 = const()[name = string("layers_4_second_sub_layer_key_net_bias_to_fp16"), val = tensor<fp16, [1024]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(18891904)))]; | |
| tensor<fp16, [1, 188, 1024]> linear_8_cast_fp16 = linear(bias = layers_4_second_sub_layer_key_net_bias_to_fp16, weight = layers_4_second_sub_layer_key_net_weight_to_fp16, x = enc_states_to_fp16)[name = string("linear_8_cast_fp16")]; | |
| tensor<int32, [4]> var_255 = const()[name = string("op_255"), val = tensor<int32, [4]>([1, 188, 8, 128])]; | |
| tensor<fp16, [1, 188, 8, 128]> var_256_cast_fp16 = reshape(shape = var_255, x = linear_8_cast_fp16)[name = string("op_256_cast_fp16")]; | |
| tensor<fp16, [1024, 1024]> layers_4_second_sub_layer_value_net_weight_to_fp16 = const()[name = string("layers_4_second_sub_layer_value_net_weight_to_fp16"), val = tensor<fp16, [1024, 1024]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(18894016)))]; | |
| tensor<fp16, [1024]> layers_4_second_sub_layer_value_net_bias_to_fp16 = const()[name = string("layers_4_second_sub_layer_value_net_bias_to_fp16"), val = tensor<fp16, [1024]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(20991232)))]; | |
| tensor<fp16, [1, 188, 1024]> linear_9_cast_fp16 = linear(bias = layers_4_second_sub_layer_value_net_bias_to_fp16, weight = layers_4_second_sub_layer_value_net_weight_to_fp16, x = enc_states_to_fp16)[name = string("linear_9_cast_fp16")]; | |
| tensor<int32, [4]> var_276 = const()[name = string("op_276"), val = tensor<int32, [4]>([1, 188, 8, 128])]; | |
| tensor<fp16, [1, 188, 8, 128]> var_277_cast_fp16 = reshape(shape = var_276, x = linear_9_cast_fp16)[name = string("op_277_cast_fp16")]; | |
| fp16 _inversed_285_y_0_to_fp16 = const()[name = string("_inversed_285_y_0_to_fp16"), val = fp16(0x1.308p-2)]; | |
| tensor<fp16, [1, 188, 8, 128]> _inversed_285_cast_fp16 = mul(x = var_256_cast_fp16, y = _inversed_285_y_0_to_fp16)[name = string("_inversed_285_cast_fp16")]; | |
| tensor<fp16, [1024, 1024]> layers_5_second_sub_layer_key_net_weight_to_fp16 = const()[name = string("layers_5_second_sub_layer_key_net_weight_to_fp16"), val = tensor<fp16, [1024, 1024]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(20993344)))]; | |
| tensor<fp16, [1024]> layers_5_second_sub_layer_key_net_bias_to_fp16 = const()[name = string("layers_5_second_sub_layer_key_net_bias_to_fp16"), val = tensor<fp16, [1024]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(23090560)))]; | |
| tensor<fp16, [1, 188, 1024]> linear_10_cast_fp16 = linear(bias = layers_5_second_sub_layer_key_net_bias_to_fp16, weight = layers_5_second_sub_layer_key_net_weight_to_fp16, x = enc_states_to_fp16)[name = string("linear_10_cast_fp16")]; | |
| tensor<int32, [4]> var_299 = const()[name = string("op_299"), val = tensor<int32, [4]>([1, 188, 8, 128])]; | |
| tensor<fp16, [1, 188, 8, 128]> var_300_cast_fp16 = reshape(shape = var_299, x = linear_10_cast_fp16)[name = string("op_300_cast_fp16")]; | |
| tensor<fp16, [1024, 1024]> layers_5_second_sub_layer_value_net_weight_to_fp16 = const()[name = string("layers_5_second_sub_layer_value_net_weight_to_fp16"), val = tensor<fp16, [1024, 1024]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(23092672)))]; | |
| tensor<fp16, [1024]> layers_5_second_sub_layer_value_net_bias_to_fp16 = const()[name = string("layers_5_second_sub_layer_value_net_bias_to_fp16"), val = tensor<fp16, [1024]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(25189888)))]; | |
| tensor<fp16, [1, 188, 1024]> linear_11_cast_fp16 = linear(bias = layers_5_second_sub_layer_value_net_bias_to_fp16, weight = layers_5_second_sub_layer_value_net_weight_to_fp16, x = enc_states_to_fp16)[name = string("linear_11_cast_fp16")]; | |
| tensor<int32, [4]> var_320 = const()[name = string("op_320"), val = tensor<int32, [4]>([1, 188, 8, 128])]; | |
| tensor<fp16, [1, 188, 8, 128]> var_321_cast_fp16 = reshape(shape = var_320, x = linear_11_cast_fp16)[name = string("op_321_cast_fp16")]; | |
| fp16 _inversed_329_y_0_to_fp16 = const()[name = string("_inversed_329_y_0_to_fp16"), val = fp16(0x1.308p-2)]; | |
| tensor<fp16, [1, 188, 8, 128]> _inversed_329_cast_fp16 = mul(x = var_300_cast_fp16, y = _inversed_329_y_0_to_fp16)[name = string("_inversed_329_cast_fp16")]; | |
| tensor<fp16, [1024, 1024]> layers_6_second_sub_layer_key_net_weight_to_fp16 = const()[name = string("layers_6_second_sub_layer_key_net_weight_to_fp16"), val = tensor<fp16, [1024, 1024]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(25192000)))]; | |
| tensor<fp16, [1024]> layers_6_second_sub_layer_key_net_bias_to_fp16 = const()[name = string("layers_6_second_sub_layer_key_net_bias_to_fp16"), val = tensor<fp16, [1024]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(27289216)))]; | |
| tensor<fp16, [1, 188, 1024]> linear_12_cast_fp16 = linear(bias = layers_6_second_sub_layer_key_net_bias_to_fp16, weight = layers_6_second_sub_layer_key_net_weight_to_fp16, x = enc_states_to_fp16)[name = string("linear_12_cast_fp16")]; | |
| tensor<int32, [4]> var_343 = const()[name = string("op_343"), val = tensor<int32, [4]>([1, 188, 8, 128])]; | |
| tensor<fp16, [1, 188, 8, 128]> var_344_cast_fp16 = reshape(shape = var_343, x = linear_12_cast_fp16)[name = string("op_344_cast_fp16")]; | |
| tensor<fp16, [1024, 1024]> layers_6_second_sub_layer_value_net_weight_to_fp16 = const()[name = string("layers_6_second_sub_layer_value_net_weight_to_fp16"), val = tensor<fp16, [1024, 1024]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(27291328)))]; | |
| tensor<fp16, [1024]> layers_6_second_sub_layer_value_net_bias_to_fp16 = const()[name = string("layers_6_second_sub_layer_value_net_bias_to_fp16"), val = tensor<fp16, [1024]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(29388544)))]; | |
| tensor<fp16, [1, 188, 1024]> linear_13_cast_fp16 = linear(bias = layers_6_second_sub_layer_value_net_bias_to_fp16, weight = layers_6_second_sub_layer_value_net_weight_to_fp16, x = enc_states_to_fp16)[name = string("linear_13_cast_fp16")]; | |
| tensor<int32, [4]> var_364 = const()[name = string("op_364"), val = tensor<int32, [4]>([1, 188, 8, 128])]; | |
| tensor<fp16, [1, 188, 8, 128]> var_365_cast_fp16 = reshape(shape = var_364, x = linear_13_cast_fp16)[name = string("op_365_cast_fp16")]; | |
| fp16 _inversed_373_y_0_to_fp16 = const()[name = string("_inversed_373_y_0_to_fp16"), val = fp16(0x1.308p-2)]; | |
| tensor<fp16, [1, 188, 8, 128]> _inversed_373_cast_fp16 = mul(x = var_344_cast_fp16, y = _inversed_373_y_0_to_fp16)[name = string("_inversed_373_cast_fp16")]; | |
| tensor<fp16, [1024, 1024]> layers_7_second_sub_layer_key_net_weight_to_fp16 = const()[name = string("layers_7_second_sub_layer_key_net_weight_to_fp16"), val = tensor<fp16, [1024, 1024]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(29390656)))]; | |
| tensor<fp16, [1024]> layers_7_second_sub_layer_key_net_bias_to_fp16 = const()[name = string("layers_7_second_sub_layer_key_net_bias_to_fp16"), val = tensor<fp16, [1024]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(31487872)))]; | |
| tensor<fp16, [1, 188, 1024]> linear_14_cast_fp16 = linear(bias = layers_7_second_sub_layer_key_net_bias_to_fp16, weight = layers_7_second_sub_layer_key_net_weight_to_fp16, x = enc_states_to_fp16)[name = string("linear_14_cast_fp16")]; | |
| tensor<int32, [4]> var_387 = const()[name = string("op_387"), val = tensor<int32, [4]>([1, 188, 8, 128])]; | |
| tensor<fp16, [1, 188, 8, 128]> var_388_cast_fp16 = reshape(shape = var_387, x = linear_14_cast_fp16)[name = string("op_388_cast_fp16")]; | |
| tensor<fp16, [1024, 1024]> layers_7_second_sub_layer_value_net_weight_to_fp16 = const()[name = string("layers_7_second_sub_layer_value_net_weight_to_fp16"), val = tensor<fp16, [1024, 1024]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(31489984)))]; | |
| tensor<fp16, [1024]> layers_7_second_sub_layer_value_net_bias_to_fp16 = const()[name = string("layers_7_second_sub_layer_value_net_bias_to_fp16"), val = tensor<fp16, [1024]>(BLOBFILE(path = string("@model_path/weights/weight.bin"), offset = uint64(33587200)))]; | |
| tensor<fp16, [1, 188, 1024]> linear_15_cast_fp16 = linear(bias = layers_7_second_sub_layer_value_net_bias_to_fp16, weight = layers_7_second_sub_layer_value_net_weight_to_fp16, x = enc_states_to_fp16)[name = string("linear_15_cast_fp16")]; | |
| tensor<int32, [4]> var_408 = const()[name = string("op_408"), val = tensor<int32, [4]>([1, 188, 8, 128])]; | |
| tensor<fp16, [1, 188, 8, 128]> var_409_cast_fp16 = reshape(shape = var_408, x = linear_15_cast_fp16)[name = string("op_409_cast_fp16")]; | |
| fp16 _inversed_417_y_0_to_fp16 = const()[name = string("_inversed_417_y_0_to_fp16"), val = fp16(0x1.308p-2)]; | |
| tensor<fp16, [1, 188, 8, 128]> _inversed_417_cast_fp16 = mul(x = var_388_cast_fp16, y = _inversed_417_y_0_to_fp16)[name = string("_inversed_417_cast_fp16")]; | |
| int32 var_420_axis_0 = const()[name = string("op_420_axis_0"), val = int32(0)]; | |
| tensor<int32, [4]> transpose_32_perm_0 = const()[name = string("transpose_32_perm_0"), val = tensor<int32, [4]>([0, 2, 1, 3])]; | |
| tensor<int32, [4]> transpose_33_perm_0 = const()[name = string("transpose_33_perm_0"), val = tensor<int32, [4]>([0, 2, 1, 3])]; | |
| tensor<int32, [4]> transpose_34_perm_0 = const()[name = string("transpose_34_perm_0"), val = tensor<int32, [4]>([0, 2, 1, 3])]; | |
| tensor<int32, [4]> transpose_35_perm_0 = const()[name = string("transpose_35_perm_0"), val = tensor<int32, [4]>([0, 2, 1, 3])]; | |
| tensor<int32, [4]> transpose_36_perm_0 = const()[name = string("transpose_36_perm_0"), val = tensor<int32, [4]>([0, 2, 1, 3])]; | |
| tensor<int32, [4]> transpose_37_perm_0 = const()[name = string("transpose_37_perm_0"), val = tensor<int32, [4]>([0, 2, 1, 3])]; | |
| tensor<int32, [4]> transpose_38_perm_0 = const()[name = string("transpose_38_perm_0"), val = tensor<int32, [4]>([0, 2, 1, 3])]; | |
| tensor<int32, [4]> transpose_39_perm_0 = const()[name = string("transpose_39_perm_0"), val = tensor<int32, [4]>([0, 2, 1, 3])]; | |
| tensor<fp16, [1, 8, 188, 128]> transpose_39 = transpose(perm = transpose_39_perm_0, x = _inversed_417_cast_fp16)[name = string("transpose_56")]; | |
| tensor<fp16, [1, 8, 188, 128]> transpose_38 = transpose(perm = transpose_38_perm_0, x = _inversed_373_cast_fp16)[name = string("transpose_57")]; | |
| tensor<fp16, [1, 8, 188, 128]> transpose_37 = transpose(perm = transpose_37_perm_0, x = _inversed_329_cast_fp16)[name = string("transpose_58")]; | |
| tensor<fp16, [1, 8, 188, 128]> transpose_36 = transpose(perm = transpose_36_perm_0, x = _inversed_285_cast_fp16)[name = string("transpose_59")]; | |
| tensor<fp16, [1, 8, 188, 128]> transpose_35 = transpose(perm = transpose_35_perm_0, x = _inversed_241_cast_fp16)[name = string("transpose_60")]; | |
| tensor<fp16, [1, 8, 188, 128]> transpose_34 = transpose(perm = transpose_34_perm_0, x = _inversed_197_cast_fp16)[name = string("transpose_61")]; | |
| tensor<fp16, [1, 8, 188, 128]> transpose_33 = transpose(perm = transpose_33_perm_0, x = _inversed_153_cast_fp16)[name = string("transpose_62")]; | |
| tensor<fp16, [1, 8, 188, 128]> transpose_32 = transpose(perm = transpose_32_perm_0, x = _inversed_109_cast_fp16)[name = string("transpose_63")]; | |
| tensor<fp16, [8, 1, 8, 188, 128]> var_420_cast_fp16 = stack(axis = var_420_axis_0, values = (transpose_32, transpose_33, transpose_34, transpose_35, transpose_36, transpose_37, transpose_38, transpose_39))[name = string("op_420_cast_fp16")]; | |
| string var_420_cast_fp16_to_fp32_dtype_0 = const()[name = string("op_420_cast_fp16_to_fp32_dtype_0"), val = string("fp32")]; | |
| int32 var_423_axis_0 = const()[name = string("op_423_axis_0"), val = int32(0)]; | |
| tensor<int32, [4]> transpose_40_perm_0 = const()[name = string("transpose_40_perm_0"), val = tensor<int32, [4]>([0, 2, 1, 3])]; | |
| tensor<int32, [4]> transpose_41_perm_0 = const()[name = string("transpose_41_perm_0"), val = tensor<int32, [4]>([0, 2, 1, 3])]; | |
| tensor<int32, [4]> transpose_42_perm_0 = const()[name = string("transpose_42_perm_0"), val = tensor<int32, [4]>([0, 2, 1, 3])]; | |
| tensor<int32, [4]> transpose_43_perm_0 = const()[name = string("transpose_43_perm_0"), val = tensor<int32, [4]>([0, 2, 1, 3])]; | |
| tensor<int32, [4]> transpose_44_perm_0 = const()[name = string("transpose_44_perm_0"), val = tensor<int32, [4]>([0, 2, 1, 3])]; | |
| tensor<int32, [4]> transpose_45_perm_0 = const()[name = string("transpose_45_perm_0"), val = tensor<int32, [4]>([0, 2, 1, 3])]; | |
| tensor<int32, [4]> transpose_46_perm_0 = const()[name = string("transpose_46_perm_0"), val = tensor<int32, [4]>([0, 2, 1, 3])]; | |
| tensor<int32, [4]> transpose_47_perm_0 = const()[name = string("transpose_47_perm_0"), val = tensor<int32, [4]>([0, 2, 1, 3])]; | |
| tensor<fp16, [1, 8, 188, 128]> transpose_47 = transpose(perm = transpose_47_perm_0, x = var_409_cast_fp16)[name = string("transpose_48")]; | |
| tensor<fp16, [1, 8, 188, 128]> transpose_46 = transpose(perm = transpose_46_perm_0, x = var_365_cast_fp16)[name = string("transpose_49")]; | |
| tensor<fp16, [1, 8, 188, 128]> transpose_45 = transpose(perm = transpose_45_perm_0, x = var_321_cast_fp16)[name = string("transpose_50")]; | |
| tensor<fp16, [1, 8, 188, 128]> transpose_44 = transpose(perm = transpose_44_perm_0, x = var_277_cast_fp16)[name = string("transpose_51")]; | |
| tensor<fp16, [1, 8, 188, 128]> transpose_43 = transpose(perm = transpose_43_perm_0, x = var_233_cast_fp16)[name = string("transpose_52")]; | |
| tensor<fp16, [1, 8, 188, 128]> transpose_42 = transpose(perm = transpose_42_perm_0, x = var_189_cast_fp16)[name = string("transpose_53")]; | |
| tensor<fp16, [1, 8, 188, 128]> transpose_41 = transpose(perm = transpose_41_perm_0, x = var_145_cast_fp16)[name = string("transpose_54")]; | |
| tensor<fp16, [1, 8, 188, 128]> transpose_40 = transpose(perm = transpose_40_perm_0, x = var_101_cast_fp16)[name = string("transpose_55")]; | |
| tensor<fp16, [8, 1, 8, 188, 128]> var_423_cast_fp16 = stack(axis = var_423_axis_0, values = (transpose_40, transpose_41, transpose_42, transpose_43, transpose_44, transpose_45, transpose_46, transpose_47))[name = string("op_423_cast_fp16")]; | |
| string var_423_cast_fp16_to_fp32_dtype_0 = const()[name = string("op_423_cast_fp16_to_fp32_dtype_0"), val = string("fp32")]; | |
| tensor<fp32, [8, 1, 8, 188, 128]> enc_v = cast(dtype = var_423_cast_fp16_to_fp32_dtype_0, x = var_423_cast_fp16)[name = string("cast_32")]; | |
| tensor<fp32, [8, 1, 8, 188, 128]> enc_k = cast(dtype = var_420_cast_fp16_to_fp32_dtype_0, x = var_420_cast_fp16)[name = string("cast_33")]; | |
| } -> (enc_k, enc_v); | |
| } |