diff --git a/Cargo.toml b/Cargo.toml index e5164297c9..a4055967c2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -39,8 +39,8 @@ git = "https://github.com/gussmith23/rplex" # issue. # NOTE Keep glenside-evaluation in sync with this # If the versions get out of whack, we'll probably have some weird errors. -rev = "ff5450f9cbe07d57e73594c5fbd68f3bd665c2dc" -git = "https://github.com/gussmith23/tvm" +rev = "4ed759f6b6cafbab707f95b57762913a1f57c021" +git = "https://github.com/hypercubestart/incubator-tvm" optional = true [dependencies.egg] @@ -53,4 +53,4 @@ features = ["approx"] [dependencies.serde] version = "1.0" -features = ["derive"] \ No newline at end of file +features = ["derive"] diff --git a/Dockerfile b/Dockerfile index 9e8880a19b..5b097606ab 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,10 +27,10 @@ ENV LLVM_CONFIG_PATH=/usr/lib/llvm-10/bin/llvm-config # Build TVM with Rust bindings # TODO(@gussmith23) Switch this to TVM mainline # once https://github.com/apache/incubator-tvm/pull/6563 is merged -RUN cd /root && git clone https://github.com/gussmith23/tvm tvm --recursive +RUN cd /root && git clone https://github.com/hypercubestart/incubator-tvm tvm --recursive WORKDIR /root/tvm RUN git fetch -RUN git checkout 14a786d3885304e5964df397a50edd19a759f903 +RUN git checkout 4ed759f6b6cafbab707f95b57762913a1f57c021 RUN git submodule sync && git submodule update RUN echo 'set(USE_LLVM $ENV{LLVM_CONFIG_PATH})' >> config.cmake RUN echo 'set(USE_RPC ON)' >> config.cmake diff --git a/models/efficientnet-lite4-11.relay b/models/efficientnet-lite4-11.relay new file mode 100644 index 0000000000..2fd80a5d6f --- /dev/null +++ b/models/efficientnet-lite4-11.relay @@ -0,0 +1,344 @@ +#[version = "0.0.5"] +def @main(%images_0: Tensor[(1, 224, 224, 3), float32], %efficientnet_lite4_model_stem_conv2d_Conv2D_weights_fused_bn: Tensor[(32, 3, 3, 3), float32], %efficientnet_lite4_model_stem_conv2d_Conv2D_bias_fused_bn: Tensor[(32), float32], %efficientnet_lite4_model_head_tpu_batch_normalization_ReadVariableOp_1_0: Tensor[(1280), float32], %efficientnet_lite4_model_head_tpu_batch_normalization_ReadVariableOp_0: Tensor[(1280), float32], %efficientnet_lite4_model_head_tpu_batch_normalization_FusedBatchNormV3_ReadVariableOp_1_0: Tensor[(1280), float32], %efficientnet_lite4_model_head_tpu_batch_normalization_FusedBatchNormV3_ReadVariableOp_0: Tensor[(1280), float32], %efficientnet_lite4_model_head_dense_MatMul_ReadVariableOp_0: Tensor[(1280, 1000), float32], %efficientnet_lite4_model_head_dense_BiasAdd_ReadVariableOp_0: Tensor[(1000), float32], %efficientnet_lite4_model_head_conv2d_Conv2D_ReadVariableOp_0: Tensor[(1280, 448, 1, 1), float32], %efficientnet_lite4_model_blocks_9_depthwise_conv2d_depthwise_weights_fused_bn: Tensor[(336, 1, 3, 3), float32], %efficientnet_lite4_model_blocks_9_depthwise_conv2d_depthwise_bias_fused_bn: Tensor[(336), float32], %efficientnet_lite4_model_blocks_9_conv2d_1_Conv2D_weights_fused_bn: Tensor[(112, 336, 1, 1), float32], %efficientnet_lite4_model_blocks_9_conv2d_1_Conv2D_bias_fused_bn: Tensor[(112), float32], %efficientnet_lite4_model_blocks_9_conv2d_Conv2D_weights_fused_bn: Tensor[(336, 56, 1, 1), float32], %efficientnet_lite4_model_blocks_9_conv2d_Conv2D_bias_fused_bn: Tensor[(336), float32], %efficientnet_lite4_model_blocks_8_depthwise_conv2d_depthwise_weights_fused_bn: Tensor[(336, 1, 5, 5), float32], %efficientnet_lite4_model_blocks_8_depthwise_conv2d_depthwise_bias_fused_bn: Tensor[(336), float32], %efficientnet_lite4_model_blocks_8_conv2d_1_Conv2D_weights_fused_bn: Tensor[(56, 336, 1, 1), float32], %efficientnet_lite4_model_blocks_8_conv2d_1_Conv2D_bias_fused_bn: Tensor[(56), float32], %efficientnet_lite4_model_blocks_8_conv2d_Conv2D_weights_fused_bn: Tensor[(336, 56, 1, 1), float32], %efficientnet_lite4_model_blocks_8_conv2d_Conv2D_bias_fused_bn: Tensor[(336), float32], %efficientnet_lite4_model_blocks_7_depthwise_conv2d_depthwise_weights_fused_bn: Tensor[(336, 1, 5, 5), float32], %efficientnet_lite4_model_blocks_7_depthwise_conv2d_depthwise_bias_fused_bn: Tensor[(336), float32], %efficientnet_lite4_model_blocks_7_conv2d_1_Conv2D_weights_fused_bn: Tensor[(56, 336, 1, 1), float32], %efficientnet_lite4_model_blocks_7_conv2d_1_Conv2D_bias_fused_bn: Tensor[(56), float32], %efficientnet_lite4_model_blocks_7_conv2d_Conv2D_weights_fused_bn: Tensor[(336, 56, 1, 1), float32], %efficientnet_lite4_model_blocks_7_conv2d_Conv2D_bias_fused_bn: Tensor[(336), float32], %efficientnet_lite4_model_blocks_6_tpu_batch_normalization_ReadVariableOp_1_0: Tensor[(336), float32], %efficientnet_lite4_model_blocks_6_tpu_batch_normalization_ReadVariableOp_0: Tensor[(336), float32], %efficientnet_lite4_model_blocks_6_tpu_batch_normalization_FusedBatchNormV3_ReadVariableOp_1_0: Tensor[(336), float32], %efficientnet_lite4_model_blocks_6_tpu_batch_normalization_FusedBatchNormV3_ReadVariableOp_0: Tensor[(336), float32], %efficientnet_lite4_model_blocks_6_depthwise_conv2d_depthwise_weights_fused_bn: Tensor[(336, 1, 5, 5), float32], %efficientnet_lite4_model_blocks_6_depthwise_conv2d_depthwise_bias_fused_bn: Tensor[(336), float32], %efficientnet_lite4_model_blocks_6_conv2d_1_Conv2D_weights_fused_bn: Tensor[(56, 336, 1, 1), float32], %efficientnet_lite4_model_blocks_6_conv2d_1_Conv2D_bias_fused_bn: Tensor[(56), float32], %efficientnet_lite4_model_blocks_6_conv2d_Conv2D_ReadVariableOp_0: Tensor[(336, 56, 1, 1), float32], %efficientnet_lite4_model_blocks_5_depthwise_conv2d_depthwise_weights_fused_bn: Tensor[(192, 1, 5, 5), float32], %efficientnet_lite4_model_blocks_5_depthwise_conv2d_depthwise_bias_fused_bn: Tensor[(192), float32], %efficientnet_lite4_model_blocks_5_conv2d_1_Conv2D_weights_fused_bn: Tensor[(56, 192, 1, 1), float32], %efficientnet_lite4_model_blocks_5_conv2d_1_Conv2D_bias_fused_bn: Tensor[(56), float32], %efficientnet_lite4_model_blocks_5_conv2d_Conv2D_weights_fused_bn: Tensor[(192, 32, 1, 1), float32], %efficientnet_lite4_model_blocks_5_conv2d_Conv2D_bias_fused_bn: Tensor[(192), float32], %efficientnet_lite4_model_blocks_4_depthwise_conv2d_depthwise_weights_fused_bn: Tensor[(192, 1, 3, 3), float32], %efficientnet_lite4_model_blocks_4_depthwise_conv2d_depthwise_bias_fused_bn: Tensor[(192), float32], %efficientnet_lite4_model_blocks_4_conv2d_1_Conv2D_weights_fused_bn: Tensor[(32, 192, 1, 1), float32], %efficientnet_lite4_model_blocks_4_conv2d_1_Conv2D_bias_fused_bn: Tensor[(32), float32], %efficientnet_lite4_model_blocks_4_conv2d_Conv2D_weights_fused_bn: Tensor[(192, 32, 1, 1), float32], %efficientnet_lite4_model_blocks_4_conv2d_Conv2D_bias_fused_bn: Tensor[(192), float32], %efficientnet_lite4_model_blocks_3_depthwise_conv2d_depthwise_weights_fused_bn: Tensor[(192, 1, 3, 3), float32], %efficientnet_lite4_model_blocks_3_depthwise_conv2d_depthwise_bias_fused_bn: Tensor[(192), float32], %efficientnet_lite4_model_blocks_3_conv2d_1_Conv2D_weights_fused_bn: Tensor[(32, 192, 1, 1), float32], %efficientnet_lite4_model_blocks_3_conv2d_1_Conv2D_bias_fused_bn: Tensor[(32), float32], %efficientnet_lite4_model_blocks_3_conv2d_Conv2D_weights_fused_bn: Tensor[(192, 32, 1, 1), float32], %efficientnet_lite4_model_blocks_3_conv2d_Conv2D_bias_fused_bn: Tensor[(192), float32], %efficientnet_lite4_model_blocks_29_depthwise_conv2d_depthwise_weights_fused_bn: Tensor[(1632, 1, 3, 3), float32], %efficientnet_lite4_model_blocks_29_depthwise_conv2d_depthwise_bias_fused_bn: Tensor[(1632), float32], %efficientnet_lite4_model_blocks_29_conv2d_1_Conv2D_weights_fused_bn: Tensor[(448, 1632, 1, 1), float32], %efficientnet_lite4_model_blocks_29_conv2d_1_Conv2D_bias_fused_bn: Tensor[(448), float32], %efficientnet_lite4_model_blocks_29_conv2d_Conv2D_weights_fused_bn: Tensor[(1632, 272, 1, 1), float32], %efficientnet_lite4_model_blocks_29_conv2d_Conv2D_bias_fused_bn: Tensor[(1632), float32], %efficientnet_lite4_model_blocks_29_Relu6_1_min__569: float32, %efficientnet_lite4_model_blocks_28_depthwise_conv2d_depthwise_weights_fused_bn: Tensor[(1632, 1, 5, 5), float32], %efficientnet_lite4_model_blocks_28_depthwise_conv2d_depthwise_bias_fused_bn: Tensor[(1632), float32], %efficientnet_lite4_model_blocks_28_conv2d_1_Conv2D_weights_fused_bn: Tensor[(272, 1632, 1, 1), float32], %efficientnet_lite4_model_blocks_28_conv2d_1_Conv2D_bias_fused_bn: Tensor[(272), float32], %efficientnet_lite4_model_blocks_28_conv2d_Conv2D_weights_fused_bn: Tensor[(1632, 272, 1, 1), float32], %efficientnet_lite4_model_blocks_28_conv2d_Conv2D_bias_fused_bn: Tensor[(1632), float32], %efficientnet_lite4_model_blocks_27_depthwise_conv2d_depthwise_weights_fused_bn: Tensor[(1632, 1, 5, 5), float32], %efficientnet_lite4_model_blocks_27_depthwise_conv2d_depthwise_bias_fused_bn: Tensor[(1632), float32], %efficientnet_lite4_model_blocks_27_conv2d_1_Conv2D_weights_fused_bn: Tensor[(272, 1632, 1, 1), float32], %efficientnet_lite4_model_blocks_27_conv2d_1_Conv2D_bias_fused_bn: Tensor[(272), float32], %efficientnet_lite4_model_blocks_27_conv2d_Conv2D_weights_fused_bn: Tensor[(1632, 272, 1, 1), float32], %efficientnet_lite4_model_blocks_27_conv2d_Conv2D_bias_fused_bn: Tensor[(1632), float32], %efficientnet_lite4_model_blocks_26_depthwise_conv2d_depthwise_weights_fused_bn: Tensor[(1632, 1, 5, 5), float32], %efficientnet_lite4_model_blocks_26_depthwise_conv2d_depthwise_bias_fused_bn: Tensor[(1632), float32], %efficientnet_lite4_model_blocks_26_conv2d_1_Conv2D_weights_fused_bn: Tensor[(272, 1632, 1, 1), float32], %efficientnet_lite4_model_blocks_26_conv2d_1_Conv2D_bias_fused_bn: Tensor[(272), float32], %efficientnet_lite4_model_blocks_26_conv2d_Conv2D_weights_fused_bn: Tensor[(1632, 272, 1, 1), float32], %efficientnet_lite4_model_blocks_26_conv2d_Conv2D_bias_fused_bn: Tensor[(1632), float32], %efficientnet_lite4_model_blocks_25_depthwise_conv2d_depthwise_weights_fused_bn: Tensor[(1632, 1, 5, 5), float32], %efficientnet_lite4_model_blocks_25_depthwise_conv2d_depthwise_bias_fused_bn: Tensor[(1632), float32], %efficientnet_lite4_model_blocks_25_conv2d_1_Conv2D_weights_fused_bn: Tensor[(272, 1632, 1, 1), float32], %efficientnet_lite4_model_blocks_25_conv2d_1_Conv2D_bias_fused_bn: Tensor[(272), float32], %efficientnet_lite4_model_blocks_25_conv2d_Conv2D_weights_fused_bn: Tensor[(1632, 272, 1, 1), float32], %efficientnet_lite4_model_blocks_25_conv2d_Conv2D_bias_fused_bn: Tensor[(1632), float32], %efficientnet_lite4_model_blocks_24_depthwise_conv2d_depthwise_weights_fused_bn: Tensor[(1632, 1, 5, 5), float32], %efficientnet_lite4_model_blocks_24_depthwise_conv2d_depthwise_bias_fused_bn: Tensor[(1632), float32], %efficientnet_lite4_model_blocks_24_conv2d_1_Conv2D_weights_fused_bn: Tensor[(272, 1632, 1, 1), float32], %efficientnet_lite4_model_blocks_24_conv2d_1_Conv2D_bias_fused_bn: Tensor[(272), float32], %efficientnet_lite4_model_blocks_24_conv2d_Conv2D_weights_fused_bn: Tensor[(1632, 272, 1, 1), float32], %efficientnet_lite4_model_blocks_24_conv2d_Conv2D_bias_fused_bn: Tensor[(1632), float32], %efficientnet_lite4_model_blocks_23_depthwise_conv2d_depthwise_weights_fused_bn: Tensor[(1632, 1, 5, 5), float32], %efficientnet_lite4_model_blocks_23_depthwise_conv2d_depthwise_bias_fused_bn: Tensor[(1632), float32], %efficientnet_lite4_model_blocks_23_conv2d_1_Conv2D_weights_fused_bn: Tensor[(272, 1632, 1, 1), float32], %efficientnet_lite4_model_blocks_23_conv2d_1_Conv2D_bias_fused_bn: Tensor[(272), float32], %efficientnet_lite4_model_blocks_23_conv2d_Conv2D_weights_fused_bn: Tensor[(1632, 272, 1, 1), float32], %efficientnet_lite4_model_blocks_23_conv2d_Conv2D_bias_fused_bn: Tensor[(1632), float32], %efficientnet_lite4_model_blocks_22_tpu_batch_normalization_ReadVariableOp_1_0: Tensor[(1632), float32], %efficientnet_lite4_model_blocks_22_tpu_batch_normalization_ReadVariableOp_0: Tensor[(1632), float32], %efficientnet_lite4_model_blocks_22_tpu_batch_normalization_FusedBatchNormV3_ReadVariableOp_1_0: Tensor[(1632), float32], %efficientnet_lite4_model_blocks_22_tpu_batch_normalization_FusedBatchNormV3_ReadVariableOp_0: Tensor[(1632), float32], %efficientnet_lite4_model_blocks_22_depthwise_conv2d_depthwise_weights_fused_bn: Tensor[(1632, 1, 5, 5), float32], %efficientnet_lite4_model_blocks_22_depthwise_conv2d_depthwise_bias_fused_bn: Tensor[(1632), float32], %efficientnet_lite4_model_blocks_22_conv2d_1_Conv2D_weights_fused_bn: Tensor[(272, 1632, 1, 1), float32], %efficientnet_lite4_model_blocks_22_conv2d_1_Conv2D_bias_fused_bn: Tensor[(272), float32], %efficientnet_lite4_model_blocks_22_conv2d_Conv2D_ReadVariableOp_0: Tensor[(1632, 272, 1, 1), float32], %efficientnet_lite4_model_blocks_21_depthwise_conv2d_depthwise_weights_fused_bn: Tensor[(960, 1, 5, 5), float32], %efficientnet_lite4_model_blocks_21_depthwise_conv2d_depthwise_bias_fused_bn: Tensor[(960), float32], %efficientnet_lite4_model_blocks_21_conv2d_1_Conv2D_weights_fused_bn: Tensor[(272, 960, 1, 1), float32], %efficientnet_lite4_model_blocks_21_conv2d_1_Conv2D_bias_fused_bn: Tensor[(272), float32], %efficientnet_lite4_model_blocks_21_conv2d_Conv2D_weights_fused_bn: Tensor[(960, 160, 1, 1), float32], %efficientnet_lite4_model_blocks_21_conv2d_Conv2D_bias_fused_bn: Tensor[(960), float32], %efficientnet_lite4_model_blocks_20_depthwise_conv2d_depthwise_weights_fused_bn: Tensor[(960, 1, 5, 5), float32], %efficientnet_lite4_model_blocks_20_depthwise_conv2d_depthwise_bias_fused_bn: Tensor[(960), float32], %efficientnet_lite4_model_blocks_20_conv2d_1_Conv2D_weights_fused_bn: Tensor[(160, 960, 1, 1), float32], %efficientnet_lite4_model_blocks_20_conv2d_1_Conv2D_bias_fused_bn: Tensor[(160), float32], %efficientnet_lite4_model_blocks_20_conv2d_Conv2D_weights_fused_bn: Tensor[(960, 160, 1, 1), float32], %efficientnet_lite4_model_blocks_20_conv2d_Conv2D_bias_fused_bn: Tensor[(960), float32], %efficientnet_lite4_model_blocks_2_tpu_batch_normalization_ReadVariableOp_1_0: Tensor[(192), float32], %efficientnet_lite4_model_blocks_2_tpu_batch_normalization_ReadVariableOp_0: Tensor[(192), float32], %efficientnet_lite4_model_blocks_2_tpu_batch_normalization_FusedBatchNormV3_ReadVariableOp_1_0: Tensor[(192), float32], %efficientnet_lite4_model_blocks_2_tpu_batch_normalization_FusedBatchNormV3_ReadVariableOp_0: Tensor[(192), float32], %efficientnet_lite4_model_blocks_2_depthwise_conv2d_depthwise_weights_fused_bn: Tensor[(192, 1, 3, 3), float32], %efficientnet_lite4_model_blocks_2_depthwise_conv2d_depthwise_bias_fused_bn: Tensor[(192), float32], %efficientnet_lite4_model_blocks_2_conv2d_1_Conv2D_weights_fused_bn: Tensor[(32, 192, 1, 1), float32], %efficientnet_lite4_model_blocks_2_conv2d_1_Conv2D_bias_fused_bn: Tensor[(32), float32], %efficientnet_lite4_model_blocks_2_conv2d_Conv2D_ReadVariableOp_0: Tensor[(192, 32, 1, 1), float32], %efficientnet_lite4_model_blocks_19_depthwise_conv2d_depthwise_weights_fused_bn: Tensor[(960, 1, 5, 5), float32], %efficientnet_lite4_model_blocks_19_depthwise_conv2d_depthwise_bias_fused_bn: Tensor[(960), float32], %efficientnet_lite4_model_blocks_19_conv2d_1_Conv2D_weights_fused_bn: Tensor[(160, 960, 1, 1), float32], %efficientnet_lite4_model_blocks_19_conv2d_1_Conv2D_bias_fused_bn: Tensor[(160), float32], %efficientnet_lite4_model_blocks_19_conv2d_Conv2D_weights_fused_bn: Tensor[(960, 160, 1, 1), float32], %efficientnet_lite4_model_blocks_19_conv2d_Conv2D_bias_fused_bn: Tensor[(960), float32], %efficientnet_lite4_model_blocks_19_Relu6_1_max__380: float32, %efficientnet_lite4_model_blocks_18_depthwise_conv2d_depthwise_weights_fused_bn: Tensor[(960, 1, 5, 5), float32], %efficientnet_lite4_model_blocks_18_depthwise_conv2d_depthwise_bias_fused_bn: Tensor[(960), float32], %efficientnet_lite4_model_blocks_18_conv2d_1_Conv2D_weights_fused_bn: Tensor[(160, 960, 1, 1), float32], %efficientnet_lite4_model_blocks_18_conv2d_1_Conv2D_bias_fused_bn: Tensor[(160), float32], %efficientnet_lite4_model_blocks_18_conv2d_Conv2D_weights_fused_bn: Tensor[(960, 160, 1, 1), float32], %efficientnet_lite4_model_blocks_18_conv2d_Conv2D_bias_fused_bn: Tensor[(960), float32], %efficientnet_lite4_model_blocks_17_depthwise_conv2d_depthwise_weights_fused_bn: Tensor[(960, 1, 5, 5), float32], %efficientnet_lite4_model_blocks_17_depthwise_conv2d_depthwise_bias_fused_bn: Tensor[(960), float32], %efficientnet_lite4_model_blocks_17_conv2d_1_Conv2D_weights_fused_bn: Tensor[(160, 960, 1, 1), float32], %efficientnet_lite4_model_blocks_17_conv2d_1_Conv2D_bias_fused_bn: Tensor[(160), float32], %efficientnet_lite4_model_blocks_17_conv2d_Conv2D_weights_fused_bn: Tensor[(960, 160, 1, 1), float32], %efficientnet_lite4_model_blocks_17_conv2d_Conv2D_bias_fused_bn: Tensor[(960), float32], %efficientnet_lite4_model_blocks_16_tpu_batch_normalization_ReadVariableOp_1_0: Tensor[(960), float32], %efficientnet_lite4_model_blocks_16_tpu_batch_normalization_ReadVariableOp_0: Tensor[(960), float32], %efficientnet_lite4_model_blocks_16_tpu_batch_normalization_FusedBatchNormV3_ReadVariableOp_1_0: Tensor[(960), float32], %efficientnet_lite4_model_blocks_16_tpu_batch_normalization_FusedBatchNormV3_ReadVariableOp_0: Tensor[(960), float32], %efficientnet_lite4_model_blocks_16_depthwise_conv2d_depthwise_weights_fused_bn: Tensor[(960, 1, 5, 5), float32], %efficientnet_lite4_model_blocks_16_depthwise_conv2d_depthwise_bias_fused_bn: Tensor[(960), float32], %efficientnet_lite4_model_blocks_16_conv2d_1_Conv2D_weights_fused_bn: Tensor[(160, 960, 1, 1), float32], %efficientnet_lite4_model_blocks_16_conv2d_1_Conv2D_bias_fused_bn: Tensor[(160), float32], %efficientnet_lite4_model_blocks_16_conv2d_Conv2D_ReadVariableOp_0: Tensor[(960, 160, 1, 1), float32], %efficientnet_lite4_model_blocks_15_depthwise_conv2d_depthwise_weights_fused_bn: Tensor[(672, 1, 5, 5), float32], %efficientnet_lite4_model_blocks_15_depthwise_conv2d_depthwise_bias_fused_bn: Tensor[(672), float32], %efficientnet_lite4_model_blocks_15_conv2d_1_Conv2D_weights_fused_bn: Tensor[(160, 672, 1, 1), float32], %efficientnet_lite4_model_blocks_15_conv2d_1_Conv2D_bias_fused_bn: Tensor[(160), float32], %efficientnet_lite4_model_blocks_15_conv2d_Conv2D_weights_fused_bn: Tensor[(672, 112, 1, 1), float32], %efficientnet_lite4_model_blocks_15_conv2d_Conv2D_bias_fused_bn: Tensor[(672), float32], %efficientnet_lite4_model_blocks_14_depthwise_conv2d_depthwise_weights_fused_bn: Tensor[(672, 1, 3, 3), float32], %efficientnet_lite4_model_blocks_14_depthwise_conv2d_depthwise_bias_fused_bn: Tensor[(672), float32], %efficientnet_lite4_model_blocks_14_conv2d_1_Conv2D_weights_fused_bn: Tensor[(112, 672, 1, 1), float32], %efficientnet_lite4_model_blocks_14_conv2d_1_Conv2D_bias_fused_bn: Tensor[(112), float32], %efficientnet_lite4_model_blocks_14_conv2d_Conv2D_weights_fused_bn: Tensor[(672, 112, 1, 1), float32], %efficientnet_lite4_model_blocks_14_conv2d_Conv2D_bias_fused_bn: Tensor[(672), float32], %efficientnet_lite4_model_blocks_13_depthwise_conv2d_depthwise_weights_fused_bn: Tensor[(672, 1, 3, 3), float32], %efficientnet_lite4_model_blocks_13_depthwise_conv2d_depthwise_bias_fused_bn: Tensor[(672), float32], %efficientnet_lite4_model_blocks_13_conv2d_1_Conv2D_weights_fused_bn: Tensor[(112, 672, 1, 1), float32], %efficientnet_lite4_model_blocks_13_conv2d_1_Conv2D_bias_fused_bn: Tensor[(112), float32], %efficientnet_lite4_model_blocks_13_conv2d_Conv2D_weights_fused_bn: Tensor[(672, 112, 1, 1), float32], %efficientnet_lite4_model_blocks_13_conv2d_Conv2D_bias_fused_bn: Tensor[(672), float32], %efficientnet_lite4_model_blocks_12_depthwise_conv2d_depthwise_weights_fused_bn: Tensor[(672, 1, 3, 3), float32], %efficientnet_lite4_model_blocks_12_depthwise_conv2d_depthwise_bias_fused_bn: Tensor[(672), float32], %efficientnet_lite4_model_blocks_12_conv2d_1_Conv2D_weights_fused_bn: Tensor[(112, 672, 1, 1), float32], %efficientnet_lite4_model_blocks_12_conv2d_1_Conv2D_bias_fused_bn: Tensor[(112), float32], %efficientnet_lite4_model_blocks_12_conv2d_Conv2D_weights_fused_bn: Tensor[(672, 112, 1, 1), float32], %efficientnet_lite4_model_blocks_12_conv2d_Conv2D_bias_fused_bn: Tensor[(672), float32], %efficientnet_lite4_model_blocks_11_depthwise_conv2d_depthwise_weights_fused_bn: Tensor[(672, 1, 3, 3), float32], %efficientnet_lite4_model_blocks_11_depthwise_conv2d_depthwise_bias_fused_bn: Tensor[(672), float32], %efficientnet_lite4_model_blocks_11_conv2d_1_Conv2D_weights_fused_bn: Tensor[(112, 672, 1, 1), float32], %efficientnet_lite4_model_blocks_11_conv2d_1_Conv2D_bias_fused_bn: Tensor[(112), float32], %efficientnet_lite4_model_blocks_11_conv2d_Conv2D_weights_fused_bn: Tensor[(672, 112, 1, 1), float32], %efficientnet_lite4_model_blocks_11_conv2d_Conv2D_bias_fused_bn: Tensor[(672), float32], %efficientnet_lite4_model_blocks_10_tpu_batch_normalization_ReadVariableOp_1_0: Tensor[(672), float32], %efficientnet_lite4_model_blocks_10_tpu_batch_normalization_ReadVariableOp_0: Tensor[(672), float32], %efficientnet_lite4_model_blocks_10_tpu_batch_normalization_FusedBatchNormV3_ReadVariableOp_1_0: Tensor[(672), float32], %efficientnet_lite4_model_blocks_10_tpu_batch_normalization_FusedBatchNormV3_ReadVariableOp_0: Tensor[(672), float32], %efficientnet_lite4_model_blocks_10_depthwise_conv2d_depthwise_weights_fused_bn: Tensor[(672, 1, 3, 3), float32], %efficientnet_lite4_model_blocks_10_depthwise_conv2d_depthwise_bias_fused_bn: Tensor[(672), float32], %efficientnet_lite4_model_blocks_10_conv2d_1_Conv2D_weights_fused_bn: Tensor[(112, 672, 1, 1), float32], %efficientnet_lite4_model_blocks_10_conv2d_1_Conv2D_bias_fused_bn: Tensor[(112), float32], %efficientnet_lite4_model_blocks_10_conv2d_Conv2D_ReadVariableOp_0: Tensor[(672, 112, 1, 1), float32], %efficientnet_lite4_model_blocks_1_tpu_batch_normalization_ReadVariableOp_1_0: Tensor[(144), float32], %efficientnet_lite4_model_blocks_1_tpu_batch_normalization_ReadVariableOp_0: Tensor[(144), float32], %efficientnet_lite4_model_blocks_1_tpu_batch_normalization_FusedBatchNormV3_ReadVariableOp_1_0: Tensor[(144), float32], %efficientnet_lite4_model_blocks_1_tpu_batch_normalization_FusedBatchNormV3_ReadVariableOp_0: Tensor[(144), float32], %efficientnet_lite4_model_blocks_1_depthwise_conv2d_depthwise_weights_fused_bn: Tensor[(144, 1, 3, 3), float32], %efficientnet_lite4_model_blocks_1_depthwise_conv2d_depthwise_bias_fused_bn: Tensor[(144), float32], %efficientnet_lite4_model_blocks_1_conv2d_1_Conv2D_weights_fused_bn: Tensor[(32, 144, 1, 1), float32], %efficientnet_lite4_model_blocks_1_conv2d_1_Conv2D_bias_fused_bn: Tensor[(32), float32], %efficientnet_lite4_model_blocks_1_conv2d_Conv2D_ReadVariableOp_0: Tensor[(144, 24, 1, 1), float32], %efficientnet_lite4_model_blocks_0_depthwise_conv2d_depthwise_weights_fused_bn: Tensor[(32, 1, 3, 3), float32], %efficientnet_lite4_model_blocks_0_depthwise_conv2d_depthwise_bias_fused_bn: Tensor[(32), float32], %efficientnet_lite4_model_blocks_0_conv2d_Conv2D_weights_fused_bn: Tensor[(24, 32, 1, 1), float32], %efficientnet_lite4_model_blocks_0_conv2d_Conv2D_bias_fused_bn: Tensor[(24), float32]) -> Tensor[(1, 1000), float32] { + %0 = transpose(%images_0, axes=[0, 3, 1, 2]) /* ty=Tensor[(1, 3, 224, 224), float32] */; + %1 = nn.conv2d(%0, %efficientnet_lite4_model_stem_conv2d_Conv2D_weights_fused_bn, strides=[2, 2], padding=[0, 0, 1, 1], kernel_size=[3, 3]) /* ty=Tensor[(1, 32, 112, 112), float32] */; + %2 = nn.bias_add(%1, %efficientnet_lite4_model_stem_conv2d_Conv2D_bias_fused_bn) /* ty=Tensor[(1, 32, 112, 112), float32] */; + %3 = maximum(%2, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 32, 112, 112), float32] */; + %4 = minimum(%3, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 32, 112, 112), float32] */; + %5 = nn.conv2d(%4, %efficientnet_lite4_model_blocks_0_depthwise_conv2d_depthwise_weights_fused_bn, padding=[1, 1, 1, 1], groups=32, kernel_size=[3, 3]) /* ty=Tensor[(1, 32, 112, 112), float32] */; + %6 = nn.bias_add(%5, %efficientnet_lite4_model_blocks_0_depthwise_conv2d_depthwise_bias_fused_bn) /* ty=Tensor[(1, 32, 112, 112), float32] */; + %7 = maximum(%6, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 32, 112, 112), float32] */; + %8 = minimum(%7, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 32, 112, 112), float32] */; + %9 = nn.conv2d(%8, %efficientnet_lite4_model_blocks_0_conv2d_Conv2D_weights_fused_bn, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 24, 112, 112), float32] */; + %10 = nn.bias_add(%9, %efficientnet_lite4_model_blocks_0_conv2d_Conv2D_bias_fused_bn) /* ty=Tensor[(1, 24, 112, 112), float32] */; + %11 = nn.conv2d(%10, %efficientnet_lite4_model_blocks_1_conv2d_Conv2D_ReadVariableOp_0, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 144, 112, 112), float32] */; + %12 = nn.batch_norm(%11, %efficientnet_lite4_model_blocks_1_tpu_batch_normalization_ReadVariableOp_0, %efficientnet_lite4_model_blocks_1_tpu_batch_normalization_ReadVariableOp_1_0, %efficientnet_lite4_model_blocks_1_tpu_batch_normalization_FusedBatchNormV3_ReadVariableOp_0, %efficientnet_lite4_model_blocks_1_tpu_batch_normalization_FusedBatchNormV3_ReadVariableOp_1_0, epsilon=0.001f) /* ty=(Tensor[(1, 144, 112, 112), float32], Tensor[(144), float32], Tensor[(144), float32]) */; + %13 = %12.0; + %14 = maximum(%13, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 144, 112, 112), float32] */; + %15 = minimum(%14, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 144, 112, 112), float32] */; + %16 = nn.conv2d(%15, %efficientnet_lite4_model_blocks_1_depthwise_conv2d_depthwise_weights_fused_bn, strides=[2, 2], padding=[0, 0, 1, 1], groups=144, kernel_size=[3, 3]) /* ty=Tensor[(1, 144, 56, 56), float32] */; + %17 = nn.bias_add(%16, %efficientnet_lite4_model_blocks_1_depthwise_conv2d_depthwise_bias_fused_bn) /* ty=Tensor[(1, 144, 56, 56), float32] */; + %18 = maximum(%17, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 144, 56, 56), float32] */; + %19 = minimum(%18, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 144, 56, 56), float32] */; + %20 = nn.conv2d(%19, %efficientnet_lite4_model_blocks_1_conv2d_1_Conv2D_weights_fused_bn, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 32, 56, 56), float32] */; + %21 = nn.bias_add(%20, %efficientnet_lite4_model_blocks_1_conv2d_1_Conv2D_bias_fused_bn) /* ty=Tensor[(1, 32, 56, 56), float32] */; + %22 = nn.conv2d(%21, %efficientnet_lite4_model_blocks_2_conv2d_Conv2D_ReadVariableOp_0, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 192, 56, 56), float32] */; + %23 = nn.batch_norm(%22, %efficientnet_lite4_model_blocks_2_tpu_batch_normalization_ReadVariableOp_0, %efficientnet_lite4_model_blocks_2_tpu_batch_normalization_ReadVariableOp_1_0, %efficientnet_lite4_model_blocks_2_tpu_batch_normalization_FusedBatchNormV3_ReadVariableOp_0, %efficientnet_lite4_model_blocks_2_tpu_batch_normalization_FusedBatchNormV3_ReadVariableOp_1_0, epsilon=0.001f) /* ty=(Tensor[(1, 192, 56, 56), float32], Tensor[(192), float32], Tensor[(192), float32]) */; + %24 = %23.0; + %25 = maximum(%24, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 192, 56, 56), float32] */; + %26 = minimum(%25, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 192, 56, 56), float32] */; + %27 = nn.conv2d(%26, %efficientnet_lite4_model_blocks_2_depthwise_conv2d_depthwise_weights_fused_bn, padding=[1, 1, 1, 1], groups=192, kernel_size=[3, 3]) /* ty=Tensor[(1, 192, 56, 56), float32] */; + %28 = nn.bias_add(%27, %efficientnet_lite4_model_blocks_2_depthwise_conv2d_depthwise_bias_fused_bn) /* ty=Tensor[(1, 192, 56, 56), float32] */; + %29 = maximum(%28, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 192, 56, 56), float32] */; + %30 = minimum(%29, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 192, 56, 56), float32] */; + %31 = nn.conv2d(%30, %efficientnet_lite4_model_blocks_2_conv2d_1_Conv2D_weights_fused_bn, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 32, 56, 56), float32] */; + %32 = nn.bias_add(%31, %efficientnet_lite4_model_blocks_2_conv2d_1_Conv2D_bias_fused_bn) /* ty=Tensor[(1, 32, 56, 56), float32] */; + %33 = add(%32, %21) /* ty=Tensor[(1, 32, 56, 56), float32] */; + %34 = nn.conv2d(%33, %efficientnet_lite4_model_blocks_3_conv2d_Conv2D_weights_fused_bn, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 192, 56, 56), float32] */; + %35 = nn.bias_add(%34, %efficientnet_lite4_model_blocks_3_conv2d_Conv2D_bias_fused_bn) /* ty=Tensor[(1, 192, 56, 56), float32] */; + %36 = maximum(%35, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 192, 56, 56), float32] */; + %37 = minimum(%36, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 192, 56, 56), float32] */; + %38 = nn.conv2d(%37, %efficientnet_lite4_model_blocks_3_depthwise_conv2d_depthwise_weights_fused_bn, padding=[1, 1, 1, 1], groups=192, kernel_size=[3, 3]) /* ty=Tensor[(1, 192, 56, 56), float32] */; + %39 = nn.bias_add(%38, %efficientnet_lite4_model_blocks_3_depthwise_conv2d_depthwise_bias_fused_bn) /* ty=Tensor[(1, 192, 56, 56), float32] */; + %40 = maximum(%39, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 192, 56, 56), float32] */; + %41 = minimum(%40, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 192, 56, 56), float32] */; + %42 = nn.conv2d(%41, %efficientnet_lite4_model_blocks_3_conv2d_1_Conv2D_weights_fused_bn, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 32, 56, 56), float32] */; + %43 = nn.bias_add(%42, %efficientnet_lite4_model_blocks_3_conv2d_1_Conv2D_bias_fused_bn) /* ty=Tensor[(1, 32, 56, 56), float32] */; + %44 = add(%43, %33) /* ty=Tensor[(1, 32, 56, 56), float32] */; + %45 = nn.conv2d(%44, %efficientnet_lite4_model_blocks_4_conv2d_Conv2D_weights_fused_bn, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 192, 56, 56), float32] */; + %46 = nn.bias_add(%45, %efficientnet_lite4_model_blocks_4_conv2d_Conv2D_bias_fused_bn) /* ty=Tensor[(1, 192, 56, 56), float32] */; + %47 = maximum(%46, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 192, 56, 56), float32] */; + %48 = minimum(%47, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 192, 56, 56), float32] */; + %49 = nn.conv2d(%48, %efficientnet_lite4_model_blocks_4_depthwise_conv2d_depthwise_weights_fused_bn, padding=[1, 1, 1, 1], groups=192, kernel_size=[3, 3]) /* ty=Tensor[(1, 192, 56, 56), float32] */; + %50 = nn.bias_add(%49, %efficientnet_lite4_model_blocks_4_depthwise_conv2d_depthwise_bias_fused_bn) /* ty=Tensor[(1, 192, 56, 56), float32] */; + %51 = maximum(%50, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 192, 56, 56), float32] */; + %52 = minimum(%51, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 192, 56, 56), float32] */; + %53 = nn.conv2d(%52, %efficientnet_lite4_model_blocks_4_conv2d_1_Conv2D_weights_fused_bn, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 32, 56, 56), float32] */; + %54 = nn.bias_add(%53, %efficientnet_lite4_model_blocks_4_conv2d_1_Conv2D_bias_fused_bn) /* ty=Tensor[(1, 32, 56, 56), float32] */; + %55 = add(%54, %44) /* ty=Tensor[(1, 32, 56, 56), float32] */; + %56 = nn.conv2d(%55, %efficientnet_lite4_model_blocks_5_conv2d_Conv2D_weights_fused_bn, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 192, 56, 56), float32] */; + %57 = nn.bias_add(%56, %efficientnet_lite4_model_blocks_5_conv2d_Conv2D_bias_fused_bn) /* ty=Tensor[(1, 192, 56, 56), float32] */; + %58 = maximum(%57, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 192, 56, 56), float32] */; + %59 = minimum(%58, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 192, 56, 56), float32] */; + %60 = nn.conv2d(%59, %efficientnet_lite4_model_blocks_5_depthwise_conv2d_depthwise_weights_fused_bn, strides=[2, 2], padding=[1, 1, 2, 2], groups=192, kernel_size=[5, 5]) /* ty=Tensor[(1, 192, 28, 28), float32] */; + %61 = nn.bias_add(%60, %efficientnet_lite4_model_blocks_5_depthwise_conv2d_depthwise_bias_fused_bn) /* ty=Tensor[(1, 192, 28, 28), float32] */; + %62 = maximum(%61, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 192, 28, 28), float32] */; + %63 = minimum(%62, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 192, 28, 28), float32] */; + %64 = nn.conv2d(%63, %efficientnet_lite4_model_blocks_5_conv2d_1_Conv2D_weights_fused_bn, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 56, 28, 28), float32] */; + %65 = nn.bias_add(%64, %efficientnet_lite4_model_blocks_5_conv2d_1_Conv2D_bias_fused_bn) /* ty=Tensor[(1, 56, 28, 28), float32] */; + %66 = nn.conv2d(%65, %efficientnet_lite4_model_blocks_6_conv2d_Conv2D_ReadVariableOp_0, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 336, 28, 28), float32] */; + %67 = nn.batch_norm(%66, %efficientnet_lite4_model_blocks_6_tpu_batch_normalization_ReadVariableOp_0, %efficientnet_lite4_model_blocks_6_tpu_batch_normalization_ReadVariableOp_1_0, %efficientnet_lite4_model_blocks_6_tpu_batch_normalization_FusedBatchNormV3_ReadVariableOp_0, %efficientnet_lite4_model_blocks_6_tpu_batch_normalization_FusedBatchNormV3_ReadVariableOp_1_0, epsilon=0.001f) /* ty=(Tensor[(1, 336, 28, 28), float32], Tensor[(336), float32], Tensor[(336), float32]) */; + %68 = %67.0; + %69 = maximum(%68, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 336, 28, 28), float32] */; + %70 = minimum(%69, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 336, 28, 28), float32] */; + %71 = nn.conv2d(%70, %efficientnet_lite4_model_blocks_6_depthwise_conv2d_depthwise_weights_fused_bn, padding=[2, 2, 2, 2], groups=336, kernel_size=[5, 5]) /* ty=Tensor[(1, 336, 28, 28), float32] */; + %72 = nn.bias_add(%71, %efficientnet_lite4_model_blocks_6_depthwise_conv2d_depthwise_bias_fused_bn) /* ty=Tensor[(1, 336, 28, 28), float32] */; + %73 = maximum(%72, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 336, 28, 28), float32] */; + %74 = minimum(%73, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 336, 28, 28), float32] */; + %75 = nn.conv2d(%74, %efficientnet_lite4_model_blocks_6_conv2d_1_Conv2D_weights_fused_bn, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 56, 28, 28), float32] */; + %76 = nn.bias_add(%75, %efficientnet_lite4_model_blocks_6_conv2d_1_Conv2D_bias_fused_bn) /* ty=Tensor[(1, 56, 28, 28), float32] */; + %77 = add(%76, %65) /* ty=Tensor[(1, 56, 28, 28), float32] */; + %78 = nn.conv2d(%77, %efficientnet_lite4_model_blocks_7_conv2d_Conv2D_weights_fused_bn, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 336, 28, 28), float32] */; + %79 = nn.bias_add(%78, %efficientnet_lite4_model_blocks_7_conv2d_Conv2D_bias_fused_bn) /* ty=Tensor[(1, 336, 28, 28), float32] */; + %80 = maximum(%79, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 336, 28, 28), float32] */; + %81 = minimum(%80, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 336, 28, 28), float32] */; + %82 = nn.conv2d(%81, %efficientnet_lite4_model_blocks_7_depthwise_conv2d_depthwise_weights_fused_bn, padding=[2, 2, 2, 2], groups=336, kernel_size=[5, 5]) /* ty=Tensor[(1, 336, 28, 28), float32] */; + %83 = nn.bias_add(%82, %efficientnet_lite4_model_blocks_7_depthwise_conv2d_depthwise_bias_fused_bn) /* ty=Tensor[(1, 336, 28, 28), float32] */; + %84 = maximum(%83, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 336, 28, 28), float32] */; + %85 = minimum(%84, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 336, 28, 28), float32] */; + %86 = nn.conv2d(%85, %efficientnet_lite4_model_blocks_7_conv2d_1_Conv2D_weights_fused_bn, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 56, 28, 28), float32] */; + %87 = nn.bias_add(%86, %efficientnet_lite4_model_blocks_7_conv2d_1_Conv2D_bias_fused_bn) /* ty=Tensor[(1, 56, 28, 28), float32] */; + %88 = add(%87, %77) /* ty=Tensor[(1, 56, 28, 28), float32] */; + %89 = nn.conv2d(%88, %efficientnet_lite4_model_blocks_8_conv2d_Conv2D_weights_fused_bn, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 336, 28, 28), float32] */; + %90 = nn.bias_add(%89, %efficientnet_lite4_model_blocks_8_conv2d_Conv2D_bias_fused_bn) /* ty=Tensor[(1, 336, 28, 28), float32] */; + %91 = maximum(%90, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 336, 28, 28), float32] */; + %92 = minimum(%91, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 336, 28, 28), float32] */; + %93 = nn.conv2d(%92, %efficientnet_lite4_model_blocks_8_depthwise_conv2d_depthwise_weights_fused_bn, padding=[2, 2, 2, 2], groups=336, kernel_size=[5, 5]) /* ty=Tensor[(1, 336, 28, 28), float32] */; + %94 = nn.bias_add(%93, %efficientnet_lite4_model_blocks_8_depthwise_conv2d_depthwise_bias_fused_bn) /* ty=Tensor[(1, 336, 28, 28), float32] */; + %95 = maximum(%94, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 336, 28, 28), float32] */; + %96 = minimum(%95, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 336, 28, 28), float32] */; + %97 = nn.conv2d(%96, %efficientnet_lite4_model_blocks_8_conv2d_1_Conv2D_weights_fused_bn, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 56, 28, 28), float32] */; + %98 = nn.bias_add(%97, %efficientnet_lite4_model_blocks_8_conv2d_1_Conv2D_bias_fused_bn) /* ty=Tensor[(1, 56, 28, 28), float32] */; + %99 = add(%98, %88) /* ty=Tensor[(1, 56, 28, 28), float32] */; + %100 = nn.conv2d(%99, %efficientnet_lite4_model_blocks_9_conv2d_Conv2D_weights_fused_bn, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 336, 28, 28), float32] */; + %101 = nn.bias_add(%100, %efficientnet_lite4_model_blocks_9_conv2d_Conv2D_bias_fused_bn) /* ty=Tensor[(1, 336, 28, 28), float32] */; + %102 = maximum(%101, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 336, 28, 28), float32] */; + %103 = minimum(%102, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 336, 28, 28), float32] */; + %104 = nn.conv2d(%103, %efficientnet_lite4_model_blocks_9_depthwise_conv2d_depthwise_weights_fused_bn, strides=[2, 2], padding=[0, 0, 1, 1], groups=336, kernel_size=[3, 3]) /* ty=Tensor[(1, 336, 14, 14), float32] */; + %105 = nn.bias_add(%104, %efficientnet_lite4_model_blocks_9_depthwise_conv2d_depthwise_bias_fused_bn) /* ty=Tensor[(1, 336, 14, 14), float32] */; + %106 = maximum(%105, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 336, 14, 14), float32] */; + %107 = minimum(%106, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 336, 14, 14), float32] */; + %108 = nn.conv2d(%107, %efficientnet_lite4_model_blocks_9_conv2d_1_Conv2D_weights_fused_bn, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 112, 14, 14), float32] */; + %109 = nn.bias_add(%108, %efficientnet_lite4_model_blocks_9_conv2d_1_Conv2D_bias_fused_bn) /* ty=Tensor[(1, 112, 14, 14), float32] */; + %110 = nn.conv2d(%109, %efficientnet_lite4_model_blocks_10_conv2d_Conv2D_ReadVariableOp_0, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 672, 14, 14), float32] */; + %111 = nn.batch_norm(%110, %efficientnet_lite4_model_blocks_10_tpu_batch_normalization_ReadVariableOp_0, %efficientnet_lite4_model_blocks_10_tpu_batch_normalization_ReadVariableOp_1_0, %efficientnet_lite4_model_blocks_10_tpu_batch_normalization_FusedBatchNormV3_ReadVariableOp_0, %efficientnet_lite4_model_blocks_10_tpu_batch_normalization_FusedBatchNormV3_ReadVariableOp_1_0, epsilon=0.001f) /* ty=(Tensor[(1, 672, 14, 14), float32], Tensor[(672), float32], Tensor[(672), float32]) */; + %112 = %111.0; + %113 = maximum(%112, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 672, 14, 14), float32] */; + %114 = minimum(%113, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 672, 14, 14), float32] */; + %115 = nn.conv2d(%114, %efficientnet_lite4_model_blocks_10_depthwise_conv2d_depthwise_weights_fused_bn, padding=[1, 1, 1, 1], groups=672, kernel_size=[3, 3]) /* ty=Tensor[(1, 672, 14, 14), float32] */; + %116 = nn.bias_add(%115, %efficientnet_lite4_model_blocks_10_depthwise_conv2d_depthwise_bias_fused_bn) /* ty=Tensor[(1, 672, 14, 14), float32] */; + %117 = maximum(%116, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 672, 14, 14), float32] */; + %118 = minimum(%117, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 672, 14, 14), float32] */; + %119 = nn.conv2d(%118, %efficientnet_lite4_model_blocks_10_conv2d_1_Conv2D_weights_fused_bn, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 112, 14, 14), float32] */; + %120 = nn.bias_add(%119, %efficientnet_lite4_model_blocks_10_conv2d_1_Conv2D_bias_fused_bn) /* ty=Tensor[(1, 112, 14, 14), float32] */; + %121 = add(%120, %109) /* ty=Tensor[(1, 112, 14, 14), float32] */; + %122 = nn.conv2d(%121, %efficientnet_lite4_model_blocks_11_conv2d_Conv2D_weights_fused_bn, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 672, 14, 14), float32] */; + %123 = nn.bias_add(%122, %efficientnet_lite4_model_blocks_11_conv2d_Conv2D_bias_fused_bn) /* ty=Tensor[(1, 672, 14, 14), float32] */; + %124 = maximum(%123, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 672, 14, 14), float32] */; + %125 = minimum(%124, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 672, 14, 14), float32] */; + %126 = nn.conv2d(%125, %efficientnet_lite4_model_blocks_11_depthwise_conv2d_depthwise_weights_fused_bn, padding=[1, 1, 1, 1], groups=672, kernel_size=[3, 3]) /* ty=Tensor[(1, 672, 14, 14), float32] */; + %127 = nn.bias_add(%126, %efficientnet_lite4_model_blocks_11_depthwise_conv2d_depthwise_bias_fused_bn) /* ty=Tensor[(1, 672, 14, 14), float32] */; + %128 = maximum(%127, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 672, 14, 14), float32] */; + %129 = minimum(%128, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 672, 14, 14), float32] */; + %130 = nn.conv2d(%129, %efficientnet_lite4_model_blocks_11_conv2d_1_Conv2D_weights_fused_bn, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 112, 14, 14), float32] */; + %131 = nn.bias_add(%130, %efficientnet_lite4_model_blocks_11_conv2d_1_Conv2D_bias_fused_bn) /* ty=Tensor[(1, 112, 14, 14), float32] */; + %132 = add(%131, %121) /* ty=Tensor[(1, 112, 14, 14), float32] */; + %133 = nn.conv2d(%132, %efficientnet_lite4_model_blocks_12_conv2d_Conv2D_weights_fused_bn, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 672, 14, 14), float32] */; + %134 = nn.bias_add(%133, %efficientnet_lite4_model_blocks_12_conv2d_Conv2D_bias_fused_bn) /* ty=Tensor[(1, 672, 14, 14), float32] */; + %135 = maximum(%134, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 672, 14, 14), float32] */; + %136 = minimum(%135, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 672, 14, 14), float32] */; + %137 = nn.conv2d(%136, %efficientnet_lite4_model_blocks_12_depthwise_conv2d_depthwise_weights_fused_bn, padding=[1, 1, 1, 1], groups=672, kernel_size=[3, 3]) /* ty=Tensor[(1, 672, 14, 14), float32] */; + %138 = nn.bias_add(%137, %efficientnet_lite4_model_blocks_12_depthwise_conv2d_depthwise_bias_fused_bn) /* ty=Tensor[(1, 672, 14, 14), float32] */; + %139 = maximum(%138, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 672, 14, 14), float32] */; + %140 = minimum(%139, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 672, 14, 14), float32] */; + %141 = nn.conv2d(%140, %efficientnet_lite4_model_blocks_12_conv2d_1_Conv2D_weights_fused_bn, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 112, 14, 14), float32] */; + %142 = nn.bias_add(%141, %efficientnet_lite4_model_blocks_12_conv2d_1_Conv2D_bias_fused_bn) /* ty=Tensor[(1, 112, 14, 14), float32] */; + %143 = add(%142, %132) /* ty=Tensor[(1, 112, 14, 14), float32] */; + %144 = nn.conv2d(%143, %efficientnet_lite4_model_blocks_13_conv2d_Conv2D_weights_fused_bn, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 672, 14, 14), float32] */; + %145 = nn.bias_add(%144, %efficientnet_lite4_model_blocks_13_conv2d_Conv2D_bias_fused_bn) /* ty=Tensor[(1, 672, 14, 14), float32] */; + %146 = maximum(%145, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 672, 14, 14), float32] */; + %147 = minimum(%146, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 672, 14, 14), float32] */; + %148 = nn.conv2d(%147, %efficientnet_lite4_model_blocks_13_depthwise_conv2d_depthwise_weights_fused_bn, padding=[1, 1, 1, 1], groups=672, kernel_size=[3, 3]) /* ty=Tensor[(1, 672, 14, 14), float32] */; + %149 = nn.bias_add(%148, %efficientnet_lite4_model_blocks_13_depthwise_conv2d_depthwise_bias_fused_bn) /* ty=Tensor[(1, 672, 14, 14), float32] */; + %150 = maximum(%149, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 672, 14, 14), float32] */; + %151 = minimum(%150, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 672, 14, 14), float32] */; + %152 = nn.conv2d(%151, %efficientnet_lite4_model_blocks_13_conv2d_1_Conv2D_weights_fused_bn, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 112, 14, 14), float32] */; + %153 = nn.bias_add(%152, %efficientnet_lite4_model_blocks_13_conv2d_1_Conv2D_bias_fused_bn) /* ty=Tensor[(1, 112, 14, 14), float32] */; + %154 = add(%153, %143) /* ty=Tensor[(1, 112, 14, 14), float32] */; + %155 = nn.conv2d(%154, %efficientnet_lite4_model_blocks_14_conv2d_Conv2D_weights_fused_bn, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 672, 14, 14), float32] */; + %156 = nn.bias_add(%155, %efficientnet_lite4_model_blocks_14_conv2d_Conv2D_bias_fused_bn) /* ty=Tensor[(1, 672, 14, 14), float32] */; + %157 = maximum(%156, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 672, 14, 14), float32] */; + %158 = minimum(%157, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 672, 14, 14), float32] */; + %159 = nn.conv2d(%158, %efficientnet_lite4_model_blocks_14_depthwise_conv2d_depthwise_weights_fused_bn, padding=[1, 1, 1, 1], groups=672, kernel_size=[3, 3]) /* ty=Tensor[(1, 672, 14, 14), float32] */; + %160 = nn.bias_add(%159, %efficientnet_lite4_model_blocks_14_depthwise_conv2d_depthwise_bias_fused_bn) /* ty=Tensor[(1, 672, 14, 14), float32] */; + %161 = maximum(%160, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 672, 14, 14), float32] */; + %162 = minimum(%161, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 672, 14, 14), float32] */; + %163 = nn.conv2d(%162, %efficientnet_lite4_model_blocks_14_conv2d_1_Conv2D_weights_fused_bn, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 112, 14, 14), float32] */; + %164 = nn.bias_add(%163, %efficientnet_lite4_model_blocks_14_conv2d_1_Conv2D_bias_fused_bn) /* ty=Tensor[(1, 112, 14, 14), float32] */; + %165 = add(%164, %154) /* ty=Tensor[(1, 112, 14, 14), float32] */; + %166 = nn.conv2d(%165, %efficientnet_lite4_model_blocks_15_conv2d_Conv2D_weights_fused_bn, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 672, 14, 14), float32] */; + %167 = nn.bias_add(%166, %efficientnet_lite4_model_blocks_15_conv2d_Conv2D_bias_fused_bn) /* ty=Tensor[(1, 672, 14, 14), float32] */; + %168 = maximum(%167, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 672, 14, 14), float32] */; + %169 = minimum(%168, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 672, 14, 14), float32] */; + %170 = nn.conv2d(%169, %efficientnet_lite4_model_blocks_15_depthwise_conv2d_depthwise_weights_fused_bn, padding=[2, 2, 2, 2], groups=672, kernel_size=[5, 5]) /* ty=Tensor[(1, 672, 14, 14), float32] */; + %171 = nn.bias_add(%170, %efficientnet_lite4_model_blocks_15_depthwise_conv2d_depthwise_bias_fused_bn) /* ty=Tensor[(1, 672, 14, 14), float32] */; + %172 = maximum(%171, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 672, 14, 14), float32] */; + %173 = minimum(%172, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 672, 14, 14), float32] */; + %174 = nn.conv2d(%173, %efficientnet_lite4_model_blocks_15_conv2d_1_Conv2D_weights_fused_bn, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 160, 14, 14), float32] */; + %175 = nn.bias_add(%174, %efficientnet_lite4_model_blocks_15_conv2d_1_Conv2D_bias_fused_bn) /* ty=Tensor[(1, 160, 14, 14), float32] */; + %176 = nn.conv2d(%175, %efficientnet_lite4_model_blocks_16_conv2d_Conv2D_ReadVariableOp_0, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 960, 14, 14), float32] */; + %177 = nn.batch_norm(%176, %efficientnet_lite4_model_blocks_16_tpu_batch_normalization_ReadVariableOp_0, %efficientnet_lite4_model_blocks_16_tpu_batch_normalization_ReadVariableOp_1_0, %efficientnet_lite4_model_blocks_16_tpu_batch_normalization_FusedBatchNormV3_ReadVariableOp_0, %efficientnet_lite4_model_blocks_16_tpu_batch_normalization_FusedBatchNormV3_ReadVariableOp_1_0, epsilon=0.001f) /* ty=(Tensor[(1, 960, 14, 14), float32], Tensor[(960), float32], Tensor[(960), float32]) */; + %178 = %177.0; + %179 = maximum(%178, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 960, 14, 14), float32] */; + %180 = minimum(%179, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 960, 14, 14), float32] */; + %181 = nn.conv2d(%180, %efficientnet_lite4_model_blocks_16_depthwise_conv2d_depthwise_weights_fused_bn, padding=[2, 2, 2, 2], groups=960, kernel_size=[5, 5]) /* ty=Tensor[(1, 960, 14, 14), float32] */; + %182 = nn.bias_add(%181, %efficientnet_lite4_model_blocks_16_depthwise_conv2d_depthwise_bias_fused_bn) /* ty=Tensor[(1, 960, 14, 14), float32] */; + %183 = maximum(%182, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 960, 14, 14), float32] */; + %184 = minimum(%183, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 960, 14, 14), float32] */; + %185 = nn.conv2d(%184, %efficientnet_lite4_model_blocks_16_conv2d_1_Conv2D_weights_fused_bn, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 160, 14, 14), float32] */; + %186 = nn.bias_add(%185, %efficientnet_lite4_model_blocks_16_conv2d_1_Conv2D_bias_fused_bn) /* ty=Tensor[(1, 160, 14, 14), float32] */; + %187 = add(%186, %175) /* ty=Tensor[(1, 160, 14, 14), float32] */; + %188 = nn.conv2d(%187, %efficientnet_lite4_model_blocks_17_conv2d_Conv2D_weights_fused_bn, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 960, 14, 14), float32] */; + %189 = nn.bias_add(%188, %efficientnet_lite4_model_blocks_17_conv2d_Conv2D_bias_fused_bn) /* ty=Tensor[(1, 960, 14, 14), float32] */; + %190 = maximum(%189, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 960, 14, 14), float32] */; + %191 = minimum(%190, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 960, 14, 14), float32] */; + %192 = nn.conv2d(%191, %efficientnet_lite4_model_blocks_17_depthwise_conv2d_depthwise_weights_fused_bn, padding=[2, 2, 2, 2], groups=960, kernel_size=[5, 5]) /* ty=Tensor[(1, 960, 14, 14), float32] */; + %193 = nn.bias_add(%192, %efficientnet_lite4_model_blocks_17_depthwise_conv2d_depthwise_bias_fused_bn) /* ty=Tensor[(1, 960, 14, 14), float32] */; + %194 = maximum(%193, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 960, 14, 14), float32] */; + %195 = minimum(%194, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 960, 14, 14), float32] */; + %196 = nn.conv2d(%195, %efficientnet_lite4_model_blocks_17_conv2d_1_Conv2D_weights_fused_bn, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 160, 14, 14), float32] */; + %197 = nn.bias_add(%196, %efficientnet_lite4_model_blocks_17_conv2d_1_Conv2D_bias_fused_bn) /* ty=Tensor[(1, 160, 14, 14), float32] */; + %198 = add(%197, %187) /* ty=Tensor[(1, 160, 14, 14), float32] */; + %199 = nn.conv2d(%198, %efficientnet_lite4_model_blocks_18_conv2d_Conv2D_weights_fused_bn, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 960, 14, 14), float32] */; + %200 = nn.bias_add(%199, %efficientnet_lite4_model_blocks_18_conv2d_Conv2D_bias_fused_bn) /* ty=Tensor[(1, 960, 14, 14), float32] */; + %201 = maximum(%200, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 960, 14, 14), float32] */; + %202 = minimum(%201, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 960, 14, 14), float32] */; + %203 = nn.conv2d(%202, %efficientnet_lite4_model_blocks_18_depthwise_conv2d_depthwise_weights_fused_bn, padding=[2, 2, 2, 2], groups=960, kernel_size=[5, 5]) /* ty=Tensor[(1, 960, 14, 14), float32] */; + %204 = nn.bias_add(%203, %efficientnet_lite4_model_blocks_18_depthwise_conv2d_depthwise_bias_fused_bn) /* ty=Tensor[(1, 960, 14, 14), float32] */; + %205 = maximum(%204, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 960, 14, 14), float32] */; + %206 = minimum(%205, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 960, 14, 14), float32] */; + %207 = nn.conv2d(%206, %efficientnet_lite4_model_blocks_18_conv2d_1_Conv2D_weights_fused_bn, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 160, 14, 14), float32] */; + %208 = nn.bias_add(%207, %efficientnet_lite4_model_blocks_18_conv2d_1_Conv2D_bias_fused_bn) /* ty=Tensor[(1, 160, 14, 14), float32] */; + %209 = add(%208, %198) /* ty=Tensor[(1, 160, 14, 14), float32] */; + %210 = nn.conv2d(%209, %efficientnet_lite4_model_blocks_19_conv2d_Conv2D_weights_fused_bn, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 960, 14, 14), float32] */; + %211 = nn.bias_add(%210, %efficientnet_lite4_model_blocks_19_conv2d_Conv2D_bias_fused_bn) /* ty=Tensor[(1, 960, 14, 14), float32] */; + %212 = maximum(%211, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 960, 14, 14), float32] */; + %213 = minimum(%212, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 960, 14, 14), float32] */; + %214 = nn.conv2d(%213, %efficientnet_lite4_model_blocks_19_depthwise_conv2d_depthwise_weights_fused_bn, padding=[2, 2, 2, 2], groups=960, kernel_size=[5, 5]) /* ty=Tensor[(1, 960, 14, 14), float32] */; + %215 = nn.bias_add(%214, %efficientnet_lite4_model_blocks_19_depthwise_conv2d_depthwise_bias_fused_bn) /* ty=Tensor[(1, 960, 14, 14), float32] */; + %216 = maximum(%215, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 960, 14, 14), float32] */; + %217 = minimum(%216, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 960, 14, 14), float32] */; + %218 = nn.conv2d(%217, %efficientnet_lite4_model_blocks_19_conv2d_1_Conv2D_weights_fused_bn, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 160, 14, 14), float32] */; + %219 = nn.bias_add(%218, %efficientnet_lite4_model_blocks_19_conv2d_1_Conv2D_bias_fused_bn) /* ty=Tensor[(1, 160, 14, 14), float32] */; + %220 = add(%219, %209) /* ty=Tensor[(1, 160, 14, 14), float32] */; + %221 = nn.conv2d(%220, %efficientnet_lite4_model_blocks_20_conv2d_Conv2D_weights_fused_bn, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 960, 14, 14), float32] */; + %222 = nn.bias_add(%221, %efficientnet_lite4_model_blocks_20_conv2d_Conv2D_bias_fused_bn) /* ty=Tensor[(1, 960, 14, 14), float32] */; + %223 = maximum(%222, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 960, 14, 14), float32] */; + %224 = minimum(%223, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 960, 14, 14), float32] */; + %225 = nn.conv2d(%224, %efficientnet_lite4_model_blocks_20_depthwise_conv2d_depthwise_weights_fused_bn, padding=[2, 2, 2, 2], groups=960, kernel_size=[5, 5]) /* ty=Tensor[(1, 960, 14, 14), float32] */; + %226 = nn.bias_add(%225, %efficientnet_lite4_model_blocks_20_depthwise_conv2d_depthwise_bias_fused_bn) /* ty=Tensor[(1, 960, 14, 14), float32] */; + %227 = maximum(%226, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 960, 14, 14), float32] */; + %228 = minimum(%227, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 960, 14, 14), float32] */; + %229 = nn.conv2d(%228, %efficientnet_lite4_model_blocks_20_conv2d_1_Conv2D_weights_fused_bn, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 160, 14, 14), float32] */; + %230 = nn.bias_add(%229, %efficientnet_lite4_model_blocks_20_conv2d_1_Conv2D_bias_fused_bn) /* ty=Tensor[(1, 160, 14, 14), float32] */; + %231 = add(%230, %220) /* ty=Tensor[(1, 160, 14, 14), float32] */; + %232 = nn.conv2d(%231, %efficientnet_lite4_model_blocks_21_conv2d_Conv2D_weights_fused_bn, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 960, 14, 14), float32] */; + %233 = nn.bias_add(%232, %efficientnet_lite4_model_blocks_21_conv2d_Conv2D_bias_fused_bn) /* ty=Tensor[(1, 960, 14, 14), float32] */; + %234 = maximum(%233, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 960, 14, 14), float32] */; + %235 = minimum(%234, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 960, 14, 14), float32] */; + %236 = nn.conv2d(%235, %efficientnet_lite4_model_blocks_21_depthwise_conv2d_depthwise_weights_fused_bn, strides=[2, 2], padding=[1, 1, 2, 2], groups=960, kernel_size=[5, 5]) /* ty=Tensor[(1, 960, 7, 7), float32] */; + %237 = nn.bias_add(%236, %efficientnet_lite4_model_blocks_21_depthwise_conv2d_depthwise_bias_fused_bn) /* ty=Tensor[(1, 960, 7, 7), float32] */; + %238 = maximum(%237, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 960, 7, 7), float32] */; + %239 = minimum(%238, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 960, 7, 7), float32] */; + %240 = nn.conv2d(%239, %efficientnet_lite4_model_blocks_21_conv2d_1_Conv2D_weights_fused_bn, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 272, 7, 7), float32] */; + %241 = nn.bias_add(%240, %efficientnet_lite4_model_blocks_21_conv2d_1_Conv2D_bias_fused_bn) /* ty=Tensor[(1, 272, 7, 7), float32] */; + %242 = nn.conv2d(%241, %efficientnet_lite4_model_blocks_22_conv2d_Conv2D_ReadVariableOp_0, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %243 = nn.batch_norm(%242, %efficientnet_lite4_model_blocks_22_tpu_batch_normalization_ReadVariableOp_0, %efficientnet_lite4_model_blocks_22_tpu_batch_normalization_ReadVariableOp_1_0, %efficientnet_lite4_model_blocks_22_tpu_batch_normalization_FusedBatchNormV3_ReadVariableOp_0, %efficientnet_lite4_model_blocks_22_tpu_batch_normalization_FusedBatchNormV3_ReadVariableOp_1_0, epsilon=0.001f) /* ty=(Tensor[(1, 1632, 7, 7), float32], Tensor[(1632), float32], Tensor[(1632), float32]) */; + %244 = %243.0; + %245 = maximum(%244, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %246 = minimum(%245, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %247 = nn.conv2d(%246, %efficientnet_lite4_model_blocks_22_depthwise_conv2d_depthwise_weights_fused_bn, padding=[2, 2, 2, 2], groups=1632, kernel_size=[5, 5]) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %248 = nn.bias_add(%247, %efficientnet_lite4_model_blocks_22_depthwise_conv2d_depthwise_bias_fused_bn) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %249 = maximum(%248, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %250 = minimum(%249, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %251 = nn.conv2d(%250, %efficientnet_lite4_model_blocks_22_conv2d_1_Conv2D_weights_fused_bn, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 272, 7, 7), float32] */; + %252 = nn.bias_add(%251, %efficientnet_lite4_model_blocks_22_conv2d_1_Conv2D_bias_fused_bn) /* ty=Tensor[(1, 272, 7, 7), float32] */; + %253 = add(%252, %241) /* ty=Tensor[(1, 272, 7, 7), float32] */; + %254 = nn.conv2d(%253, %efficientnet_lite4_model_blocks_23_conv2d_Conv2D_weights_fused_bn, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %255 = nn.bias_add(%254, %efficientnet_lite4_model_blocks_23_conv2d_Conv2D_bias_fused_bn) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %256 = maximum(%255, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %257 = minimum(%256, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %258 = nn.conv2d(%257, %efficientnet_lite4_model_blocks_23_depthwise_conv2d_depthwise_weights_fused_bn, padding=[2, 2, 2, 2], groups=1632, kernel_size=[5, 5]) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %259 = nn.bias_add(%258, %efficientnet_lite4_model_blocks_23_depthwise_conv2d_depthwise_bias_fused_bn) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %260 = maximum(%259, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %261 = minimum(%260, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %262 = nn.conv2d(%261, %efficientnet_lite4_model_blocks_23_conv2d_1_Conv2D_weights_fused_bn, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 272, 7, 7), float32] */; + %263 = nn.bias_add(%262, %efficientnet_lite4_model_blocks_23_conv2d_1_Conv2D_bias_fused_bn) /* ty=Tensor[(1, 272, 7, 7), float32] */; + %264 = add(%263, %253) /* ty=Tensor[(1, 272, 7, 7), float32] */; + %265 = nn.conv2d(%264, %efficientnet_lite4_model_blocks_24_conv2d_Conv2D_weights_fused_bn, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %266 = nn.bias_add(%265, %efficientnet_lite4_model_blocks_24_conv2d_Conv2D_bias_fused_bn) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %267 = maximum(%266, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %268 = minimum(%267, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %269 = nn.conv2d(%268, %efficientnet_lite4_model_blocks_24_depthwise_conv2d_depthwise_weights_fused_bn, padding=[2, 2, 2, 2], groups=1632, kernel_size=[5, 5]) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %270 = nn.bias_add(%269, %efficientnet_lite4_model_blocks_24_depthwise_conv2d_depthwise_bias_fused_bn) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %271 = maximum(%270, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %272 = minimum(%271, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %273 = nn.conv2d(%272, %efficientnet_lite4_model_blocks_24_conv2d_1_Conv2D_weights_fused_bn, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 272, 7, 7), float32] */; + %274 = nn.bias_add(%273, %efficientnet_lite4_model_blocks_24_conv2d_1_Conv2D_bias_fused_bn) /* ty=Tensor[(1, 272, 7, 7), float32] */; + %275 = add(%274, %264) /* ty=Tensor[(1, 272, 7, 7), float32] */; + %276 = nn.conv2d(%275, %efficientnet_lite4_model_blocks_25_conv2d_Conv2D_weights_fused_bn, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %277 = nn.bias_add(%276, %efficientnet_lite4_model_blocks_25_conv2d_Conv2D_bias_fused_bn) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %278 = maximum(%277, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %279 = minimum(%278, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %280 = nn.conv2d(%279, %efficientnet_lite4_model_blocks_25_depthwise_conv2d_depthwise_weights_fused_bn, padding=[2, 2, 2, 2], groups=1632, kernel_size=[5, 5]) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %281 = nn.bias_add(%280, %efficientnet_lite4_model_blocks_25_depthwise_conv2d_depthwise_bias_fused_bn) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %282 = maximum(%281, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %283 = minimum(%282, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %284 = nn.conv2d(%283, %efficientnet_lite4_model_blocks_25_conv2d_1_Conv2D_weights_fused_bn, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 272, 7, 7), float32] */; + %285 = nn.bias_add(%284, %efficientnet_lite4_model_blocks_25_conv2d_1_Conv2D_bias_fused_bn) /* ty=Tensor[(1, 272, 7, 7), float32] */; + %286 = add(%285, %275) /* ty=Tensor[(1, 272, 7, 7), float32] */; + %287 = nn.conv2d(%286, %efficientnet_lite4_model_blocks_26_conv2d_Conv2D_weights_fused_bn, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %288 = nn.bias_add(%287, %efficientnet_lite4_model_blocks_26_conv2d_Conv2D_bias_fused_bn) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %289 = maximum(%288, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %290 = minimum(%289, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %291 = nn.conv2d(%290, %efficientnet_lite4_model_blocks_26_depthwise_conv2d_depthwise_weights_fused_bn, padding=[2, 2, 2, 2], groups=1632, kernel_size=[5, 5]) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %292 = nn.bias_add(%291, %efficientnet_lite4_model_blocks_26_depthwise_conv2d_depthwise_bias_fused_bn) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %293 = maximum(%292, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %294 = minimum(%293, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %295 = nn.conv2d(%294, %efficientnet_lite4_model_blocks_26_conv2d_1_Conv2D_weights_fused_bn, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 272, 7, 7), float32] */; + %296 = nn.bias_add(%295, %efficientnet_lite4_model_blocks_26_conv2d_1_Conv2D_bias_fused_bn) /* ty=Tensor[(1, 272, 7, 7), float32] */; + %297 = add(%296, %286) /* ty=Tensor[(1, 272, 7, 7), float32] */; + %298 = nn.conv2d(%297, %efficientnet_lite4_model_blocks_27_conv2d_Conv2D_weights_fused_bn, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %299 = nn.bias_add(%298, %efficientnet_lite4_model_blocks_27_conv2d_Conv2D_bias_fused_bn) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %300 = maximum(%299, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %301 = minimum(%300, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %302 = nn.conv2d(%301, %efficientnet_lite4_model_blocks_27_depthwise_conv2d_depthwise_weights_fused_bn, padding=[2, 2, 2, 2], groups=1632, kernel_size=[5, 5]) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %303 = nn.bias_add(%302, %efficientnet_lite4_model_blocks_27_depthwise_conv2d_depthwise_bias_fused_bn) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %304 = maximum(%303, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %305 = minimum(%304, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %306 = nn.conv2d(%305, %efficientnet_lite4_model_blocks_27_conv2d_1_Conv2D_weights_fused_bn, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 272, 7, 7), float32] */; + %307 = nn.bias_add(%306, %efficientnet_lite4_model_blocks_27_conv2d_1_Conv2D_bias_fused_bn) /* ty=Tensor[(1, 272, 7, 7), float32] */; + %308 = add(%307, %297) /* ty=Tensor[(1, 272, 7, 7), float32] */; + %309 = nn.conv2d(%308, %efficientnet_lite4_model_blocks_28_conv2d_Conv2D_weights_fused_bn, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %310 = nn.bias_add(%309, %efficientnet_lite4_model_blocks_28_conv2d_Conv2D_bias_fused_bn) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %311 = maximum(%310, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %312 = minimum(%311, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %313 = nn.conv2d(%312, %efficientnet_lite4_model_blocks_28_depthwise_conv2d_depthwise_weights_fused_bn, padding=[2, 2, 2, 2], groups=1632, kernel_size=[5, 5]) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %314 = nn.bias_add(%313, %efficientnet_lite4_model_blocks_28_depthwise_conv2d_depthwise_bias_fused_bn) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %315 = maximum(%314, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %316 = minimum(%315, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %317 = nn.conv2d(%316, %efficientnet_lite4_model_blocks_28_conv2d_1_Conv2D_weights_fused_bn, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 272, 7, 7), float32] */; + %318 = nn.bias_add(%317, %efficientnet_lite4_model_blocks_28_conv2d_1_Conv2D_bias_fused_bn) /* ty=Tensor[(1, 272, 7, 7), float32] */; + %319 = add(%318, %308) /* ty=Tensor[(1, 272, 7, 7), float32] */; + %320 = nn.conv2d(%319, %efficientnet_lite4_model_blocks_29_conv2d_Conv2D_weights_fused_bn, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %321 = nn.bias_add(%320, %efficientnet_lite4_model_blocks_29_conv2d_Conv2D_bias_fused_bn) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %322 = maximum(%321, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %323 = minimum(%322, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %324 = nn.conv2d(%323, %efficientnet_lite4_model_blocks_29_depthwise_conv2d_depthwise_weights_fused_bn, padding=[1, 1, 1, 1], groups=1632, kernel_size=[3, 3]) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %325 = nn.bias_add(%324, %efficientnet_lite4_model_blocks_29_depthwise_conv2d_depthwise_bias_fused_bn) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %326 = maximum(%325, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %327 = minimum(%326, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 1632, 7, 7), float32] */; + %328 = nn.conv2d(%327, %efficientnet_lite4_model_blocks_29_conv2d_1_Conv2D_weights_fused_bn, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 448, 7, 7), float32] */; + %329 = nn.bias_add(%328, %efficientnet_lite4_model_blocks_29_conv2d_1_Conv2D_bias_fused_bn) /* ty=Tensor[(1, 448, 7, 7), float32] */; + %330 = nn.conv2d(%329, %efficientnet_lite4_model_head_conv2d_Conv2D_ReadVariableOp_0, padding=[0, 0, 0, 0], kernel_size=[1, 1]) /* ty=Tensor[(1, 1280, 7, 7), float32] */; + %331 = nn.batch_norm(%330, %efficientnet_lite4_model_head_tpu_batch_normalization_ReadVariableOp_0, %efficientnet_lite4_model_head_tpu_batch_normalization_ReadVariableOp_1_0, %efficientnet_lite4_model_head_tpu_batch_normalization_FusedBatchNormV3_ReadVariableOp_0, %efficientnet_lite4_model_head_tpu_batch_normalization_FusedBatchNormV3_ReadVariableOp_1_0, epsilon=0.001f) /* ty=(Tensor[(1, 1280, 7, 7), float32], Tensor[(1280), float32], Tensor[(1280), float32]) */; + %332 = %331.0; + %333 = maximum(%332, %efficientnet_lite4_model_blocks_29_Relu6_1_min__569) /* ty=Tensor[(1, 1280, 7, 7), float32] */; + %334 = minimum(%333, %efficientnet_lite4_model_blocks_19_Relu6_1_max__380) /* ty=Tensor[(1, 1280, 7, 7), float32] */; + %335 = nn.avg_pool2d(%334, pool_size=[7, 7], padding=[0, 0, 0, 0]) /* ty=Tensor[(1, 1280, 1, 1), float32] */; + %336 = squeeze(%335, axis=[2, 3]) /* ty=Tensor[(1, 1280), float32] */; + %337 = transpose(%efficientnet_lite4_model_head_dense_MatMul_ReadVariableOp_0, axes=[1, 0]) /* ty=Tensor[(1000, 1280), float32] */; + %338 = nn.dense(%336, %337, units=1000) /* ty=Tensor[(1, 1000), float32] */; + %339 = add(%338, %efficientnet_lite4_model_head_dense_BiasAdd_ReadVariableOp_0) /* ty=Tensor[(1, 1000), float32] */; + nn.softmax(%339, axis=1) /* ty=Tensor[(1, 1000), float32] */ +} diff --git a/models/yolov3.relay b/models/yolov3.relay new file mode 100644 index 0000000000..cea8ad794b --- /dev/null +++ b/models/yolov3.relay @@ -0,0 +1,357 @@ +#[version = "0.0.5"] +def @main(%data: Tensor[(1, 3, 416, 416), float32], %LAYERTYPE_CONVOLUTIONAL0_weight: Tensor[(32, 3, 3, 3), float32], %LAYERTYPE_CONVOLUTIONAL0_gamma: Tensor[(32), float32], %LAYERTYPE_CONVOLUTIONAL0_beta: Tensor[(32), float32], %LAYERTYPE_CONVOLUTIONAL0_moving_mean: Tensor[(32), float32], %LAYERTYPE_CONVOLUTIONAL0_moving_var: Tensor[(32), float32], %LAYERTYPE_CONVOLUTIONAL1_weight: Tensor[(64, 32, 3, 3), float32], %LAYERTYPE_CONVOLUTIONAL1_gamma: Tensor[(64), float32], %LAYERTYPE_CONVOLUTIONAL1_beta: Tensor[(64), float32], %LAYERTYPE_CONVOLUTIONAL1_moving_mean: Tensor[(64), float32], %LAYERTYPE_CONVOLUTIONAL1_moving_var: Tensor[(64), float32], %LAYERTYPE_CONVOLUTIONAL2_weight: Tensor[(32, 64, 1, 1), float32], %LAYERTYPE_CONVOLUTIONAL2_gamma: Tensor[(32), float32], %LAYERTYPE_CONVOLUTIONAL2_beta: Tensor[(32), float32], %LAYERTYPE_CONVOLUTIONAL2_moving_mean: Tensor[(32), float32], %LAYERTYPE_CONVOLUTIONAL2_moving_var: Tensor[(32), float32], %LAYERTYPE_CONVOLUTIONAL3_weight: Tensor[(64, 32, 3, 3), float32], %LAYERTYPE_CONVOLUTIONAL3_gamma: Tensor[(64), float32], %LAYERTYPE_CONVOLUTIONAL3_beta: Tensor[(64), float32], %LAYERTYPE_CONVOLUTIONAL3_moving_mean: Tensor[(64), float32], %LAYERTYPE_CONVOLUTIONAL3_moving_var: Tensor[(64), float32], %LAYERTYPE_CONVOLUTIONAL5_weight: Tensor[(128, 64, 3, 3), float32], %LAYERTYPE_CONVOLUTIONAL5_gamma: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL5_beta: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL5_moving_mean: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL5_moving_var: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL6_weight: Tensor[(64, 128, 1, 1), float32], %LAYERTYPE_CONVOLUTIONAL6_gamma: Tensor[(64), float32], %LAYERTYPE_CONVOLUTIONAL6_beta: Tensor[(64), float32], %LAYERTYPE_CONVOLUTIONAL6_moving_mean: Tensor[(64), float32], %LAYERTYPE_CONVOLUTIONAL6_moving_var: Tensor[(64), float32], %LAYERTYPE_CONVOLUTIONAL7_weight: Tensor[(128, 64, 3, 3), float32], %LAYERTYPE_CONVOLUTIONAL7_gamma: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL7_beta: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL7_moving_mean: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL7_moving_var: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL9_weight: Tensor[(64, 128, 1, 1), float32], %LAYERTYPE_CONVOLUTIONAL9_gamma: Tensor[(64), float32], %LAYERTYPE_CONVOLUTIONAL9_beta: Tensor[(64), float32], %LAYERTYPE_CONVOLUTIONAL9_moving_mean: Tensor[(64), float32], %LAYERTYPE_CONVOLUTIONAL9_moving_var: Tensor[(64), float32], %LAYERTYPE_CONVOLUTIONAL10_weight: Tensor[(128, 64, 3, 3), float32], %LAYERTYPE_CONVOLUTIONAL10_gamma: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL10_beta: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL10_moving_mean: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL10_moving_var: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL12_weight: Tensor[(256, 128, 3, 3), float32], %LAYERTYPE_CONVOLUTIONAL12_gamma: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL12_beta: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL12_moving_mean: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL12_moving_var: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL13_weight: Tensor[(128, 256, 1, 1), float32], %LAYERTYPE_CONVOLUTIONAL13_gamma: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL13_beta: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL13_moving_mean: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL13_moving_var: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL14_weight: Tensor[(256, 128, 3, 3), float32], %LAYERTYPE_CONVOLUTIONAL14_gamma: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL14_beta: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL14_moving_mean: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL14_moving_var: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL16_weight: Tensor[(128, 256, 1, 1), float32], %LAYERTYPE_CONVOLUTIONAL16_gamma: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL16_beta: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL16_moving_mean: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL16_moving_var: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL17_weight: Tensor[(256, 128, 3, 3), float32], %LAYERTYPE_CONVOLUTIONAL17_gamma: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL17_beta: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL17_moving_mean: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL17_moving_var: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL19_weight: Tensor[(128, 256, 1, 1), float32], %LAYERTYPE_CONVOLUTIONAL19_gamma: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL19_beta: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL19_moving_mean: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL19_moving_var: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL20_weight: Tensor[(256, 128, 3, 3), float32], %LAYERTYPE_CONVOLUTIONAL20_gamma: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL20_beta: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL20_moving_mean: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL20_moving_var: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL22_weight: Tensor[(128, 256, 1, 1), float32], %LAYERTYPE_CONVOLUTIONAL22_gamma: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL22_beta: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL22_moving_mean: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL22_moving_var: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL23_weight: Tensor[(256, 128, 3, 3), float32], %LAYERTYPE_CONVOLUTIONAL23_gamma: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL23_beta: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL23_moving_mean: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL23_moving_var: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL25_weight: Tensor[(128, 256, 1, 1), float32], %LAYERTYPE_CONVOLUTIONAL25_gamma: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL25_beta: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL25_moving_mean: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL25_moving_var: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL26_weight: Tensor[(256, 128, 3, 3), float32], %LAYERTYPE_CONVOLUTIONAL26_gamma: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL26_beta: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL26_moving_mean: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL26_moving_var: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL28_weight: Tensor[(128, 256, 1, 1), float32], %LAYERTYPE_CONVOLUTIONAL28_gamma: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL28_beta: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL28_moving_mean: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL28_moving_var: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL29_weight: Tensor[(256, 128, 3, 3), float32], %LAYERTYPE_CONVOLUTIONAL29_gamma: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL29_beta: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL29_moving_mean: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL29_moving_var: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL31_weight: Tensor[(128, 256, 1, 1), float32], %LAYERTYPE_CONVOLUTIONAL31_gamma: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL31_beta: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL31_moving_mean: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL31_moving_var: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL32_weight: Tensor[(256, 128, 3, 3), float32], %LAYERTYPE_CONVOLUTIONAL32_gamma: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL32_beta: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL32_moving_mean: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL32_moving_var: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL34_weight: Tensor[(128, 256, 1, 1), float32], %LAYERTYPE_CONVOLUTIONAL34_gamma: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL34_beta: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL34_moving_mean: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL34_moving_var: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL35_weight: Tensor[(256, 128, 3, 3), float32], %LAYERTYPE_CONVOLUTIONAL35_gamma: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL35_beta: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL35_moving_mean: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL35_moving_var: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL37_weight: Tensor[(512, 256, 3, 3), float32], %LAYERTYPE_CONVOLUTIONAL37_gamma: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL37_beta: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL37_moving_mean: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL37_moving_var: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL38_weight: Tensor[(256, 512, 1, 1), float32], %LAYERTYPE_CONVOLUTIONAL38_gamma: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL38_beta: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL38_moving_mean: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL38_moving_var: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL39_weight: Tensor[(512, 256, 3, 3), float32], %LAYERTYPE_CONVOLUTIONAL39_gamma: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL39_beta: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL39_moving_mean: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL39_moving_var: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL41_weight: Tensor[(256, 512, 1, 1), float32], %LAYERTYPE_CONVOLUTIONAL41_gamma: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL41_beta: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL41_moving_mean: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL41_moving_var: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL42_weight: Tensor[(512, 256, 3, 3), float32], %LAYERTYPE_CONVOLUTIONAL42_gamma: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL42_beta: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL42_moving_mean: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL42_moving_var: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL44_weight: Tensor[(256, 512, 1, 1), float32], %LAYERTYPE_CONVOLUTIONAL44_gamma: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL44_beta: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL44_moving_mean: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL44_moving_var: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL45_weight: Tensor[(512, 256, 3, 3), float32], %LAYERTYPE_CONVOLUTIONAL45_gamma: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL45_beta: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL45_moving_mean: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL45_moving_var: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL47_weight: Tensor[(256, 512, 1, 1), float32], %LAYERTYPE_CONVOLUTIONAL47_gamma: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL47_beta: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL47_moving_mean: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL47_moving_var: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL48_weight: Tensor[(512, 256, 3, 3), float32], %LAYERTYPE_CONVOLUTIONAL48_gamma: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL48_beta: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL48_moving_mean: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL48_moving_var: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL50_weight: Tensor[(256, 512, 1, 1), float32], %LAYERTYPE_CONVOLUTIONAL50_gamma: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL50_beta: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL50_moving_mean: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL50_moving_var: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL51_weight: Tensor[(512, 256, 3, 3), float32], %LAYERTYPE_CONVOLUTIONAL51_gamma: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL51_beta: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL51_moving_mean: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL51_moving_var: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL53_weight: Tensor[(256, 512, 1, 1), float32], %LAYERTYPE_CONVOLUTIONAL53_gamma: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL53_beta: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL53_moving_mean: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL53_moving_var: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL54_weight: Tensor[(512, 256, 3, 3), float32], %LAYERTYPE_CONVOLUTIONAL54_gamma: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL54_beta: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL54_moving_mean: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL54_moving_var: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL56_weight: Tensor[(256, 512, 1, 1), float32], %LAYERTYPE_CONVOLUTIONAL56_gamma: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL56_beta: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL56_moving_mean: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL56_moving_var: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL57_weight: Tensor[(512, 256, 3, 3), float32], %LAYERTYPE_CONVOLUTIONAL57_gamma: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL57_beta: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL57_moving_mean: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL57_moving_var: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL59_weight: Tensor[(256, 512, 1, 1), float32], %LAYERTYPE_CONVOLUTIONAL59_gamma: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL59_beta: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL59_moving_mean: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL59_moving_var: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL60_weight: Tensor[(512, 256, 3, 3), float32], %LAYERTYPE_CONVOLUTIONAL60_gamma: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL60_beta: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL60_moving_mean: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL60_moving_var: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL62_weight: Tensor[(1024, 512, 3, 3), float32], %LAYERTYPE_CONVOLUTIONAL62_gamma: Tensor[(1024), float32], %LAYERTYPE_CONVOLUTIONAL62_beta: Tensor[(1024), float32], %LAYERTYPE_CONVOLUTIONAL62_moving_mean: Tensor[(1024), float32], %LAYERTYPE_CONVOLUTIONAL62_moving_var: Tensor[(1024), float32], %LAYERTYPE_CONVOLUTIONAL63_weight: Tensor[(512, 1024, 1, 1), float32], %LAYERTYPE_CONVOLUTIONAL63_gamma: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL63_beta: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL63_moving_mean: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL63_moving_var: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL64_weight: Tensor[(1024, 512, 3, 3), float32], %LAYERTYPE_CONVOLUTIONAL64_gamma: Tensor[(1024), float32], %LAYERTYPE_CONVOLUTIONAL64_beta: Tensor[(1024), float32], %LAYERTYPE_CONVOLUTIONAL64_moving_mean: Tensor[(1024), float32], %LAYERTYPE_CONVOLUTIONAL64_moving_var: Tensor[(1024), float32], %LAYERTYPE_CONVOLUTIONAL66_weight: Tensor[(512, 1024, 1, 1), float32], %LAYERTYPE_CONVOLUTIONAL66_gamma: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL66_beta: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL66_moving_mean: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL66_moving_var: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL67_weight: Tensor[(1024, 512, 3, 3), float32], %LAYERTYPE_CONVOLUTIONAL67_gamma: Tensor[(1024), float32], %LAYERTYPE_CONVOLUTIONAL67_beta: Tensor[(1024), float32], %LAYERTYPE_CONVOLUTIONAL67_moving_mean: Tensor[(1024), float32], %LAYERTYPE_CONVOLUTIONAL67_moving_var: Tensor[(1024), float32], %LAYERTYPE_CONVOLUTIONAL69_weight: Tensor[(512, 1024, 1, 1), float32], %LAYERTYPE_CONVOLUTIONAL69_gamma: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL69_beta: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL69_moving_mean: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL69_moving_var: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL70_weight: Tensor[(1024, 512, 3, 3), float32], %LAYERTYPE_CONVOLUTIONAL70_gamma: Tensor[(1024), float32], %LAYERTYPE_CONVOLUTIONAL70_beta: Tensor[(1024), float32], %LAYERTYPE_CONVOLUTIONAL70_moving_mean: Tensor[(1024), float32], %LAYERTYPE_CONVOLUTIONAL70_moving_var: Tensor[(1024), float32], %LAYERTYPE_CONVOLUTIONAL72_weight: Tensor[(512, 1024, 1, 1), float32], %LAYERTYPE_CONVOLUTIONAL72_gamma: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL72_beta: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL72_moving_mean: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL72_moving_var: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL73_weight: Tensor[(1024, 512, 3, 3), float32], %LAYERTYPE_CONVOLUTIONAL73_gamma: Tensor[(1024), float32], %LAYERTYPE_CONVOLUTIONAL73_beta: Tensor[(1024), float32], %LAYERTYPE_CONVOLUTIONAL73_moving_mean: Tensor[(1024), float32], %LAYERTYPE_CONVOLUTIONAL73_moving_var: Tensor[(1024), float32], %LAYERTYPE_CONVOLUTIONAL75_weight: Tensor[(512, 1024, 1, 1), float32], %LAYERTYPE_CONVOLUTIONAL75_gamma: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL75_beta: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL75_moving_mean: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL75_moving_var: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL76_weight: Tensor[(1024, 512, 3, 3), float32], %LAYERTYPE_CONVOLUTIONAL76_gamma: Tensor[(1024), float32], %LAYERTYPE_CONVOLUTIONAL76_beta: Tensor[(1024), float32], %LAYERTYPE_CONVOLUTIONAL76_moving_mean: Tensor[(1024), float32], %LAYERTYPE_CONVOLUTIONAL76_moving_var: Tensor[(1024), float32], %LAYERTYPE_CONVOLUTIONAL77_weight: Tensor[(512, 1024, 1, 1), float32], %LAYERTYPE_CONVOLUTIONAL77_gamma: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL77_beta: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL77_moving_mean: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL77_moving_var: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL78_weight: Tensor[(1024, 512, 3, 3), float32], %LAYERTYPE_CONVOLUTIONAL78_gamma: Tensor[(1024), float32], %LAYERTYPE_CONVOLUTIONAL78_beta: Tensor[(1024), float32], %LAYERTYPE_CONVOLUTIONAL78_moving_mean: Tensor[(1024), float32], %LAYERTYPE_CONVOLUTIONAL78_moving_var: Tensor[(1024), float32], %LAYERTYPE_CONVOLUTIONAL79_weight: Tensor[(512, 1024, 1, 1), float32], %LAYERTYPE_CONVOLUTIONAL79_gamma: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL79_beta: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL79_moving_mean: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL79_moving_var: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL84_weight: Tensor[(256, 512, 1, 1), float32], %LAYERTYPE_CONVOLUTIONAL84_gamma: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL84_beta: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL84_moving_mean: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL84_moving_var: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL87_weight: Tensor[(256, 768, 1, 1), float32], %LAYERTYPE_CONVOLUTIONAL87_gamma: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL87_beta: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL87_moving_mean: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL87_moving_var: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL88_weight: Tensor[(512, 256, 3, 3), float32], %LAYERTYPE_CONVOLUTIONAL88_gamma: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL88_beta: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL88_moving_mean: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL88_moving_var: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL89_weight: Tensor[(256, 512, 1, 1), float32], %LAYERTYPE_CONVOLUTIONAL89_gamma: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL89_beta: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL89_moving_mean: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL89_moving_var: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL90_weight: Tensor[(512, 256, 3, 3), float32], %LAYERTYPE_CONVOLUTIONAL90_gamma: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL90_beta: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL90_moving_mean: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL90_moving_var: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL91_weight: Tensor[(256, 512, 1, 1), float32], %LAYERTYPE_CONVOLUTIONAL91_gamma: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL91_beta: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL91_moving_mean: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL91_moving_var: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL96_weight: Tensor[(128, 256, 1, 1), float32], %LAYERTYPE_CONVOLUTIONAL96_gamma: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL96_beta: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL96_moving_mean: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL96_moving_var: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL99_weight: Tensor[(128, 384, 1, 1), float32], %LAYERTYPE_CONVOLUTIONAL99_gamma: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL99_beta: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL99_moving_mean: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL99_moving_var: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL100_weight: Tensor[(256, 128, 3, 3), float32], %LAYERTYPE_CONVOLUTIONAL100_gamma: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL100_beta: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL100_moving_mean: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL100_moving_var: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL101_weight: Tensor[(128, 256, 1, 1), float32], %LAYERTYPE_CONVOLUTIONAL101_gamma: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL101_beta: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL101_moving_mean: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL101_moving_var: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL102_weight: Tensor[(256, 128, 3, 3), float32], %LAYERTYPE_CONVOLUTIONAL102_gamma: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL102_beta: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL102_moving_mean: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL102_moving_var: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL103_weight: Tensor[(128, 256, 1, 1), float32], %LAYERTYPE_CONVOLUTIONAL103_gamma: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL103_beta: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL103_moving_mean: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL103_moving_var: Tensor[(128), float32], %LAYERTYPE_CONVOLUTIONAL104_weight: Tensor[(256, 128, 3, 3), float32], %LAYERTYPE_CONVOLUTIONAL104_gamma: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL104_beta: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL104_moving_mean: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL104_moving_var: Tensor[(256), float32], %LAYERTYPE_CONVOLUTIONAL105_weight: Tensor[(255, 256, 1, 1), float32], %LAYERTYPE_CONVOLUTIONAL105_bias: Tensor[(255), float32], %LAYERTYPE_YOLO106_mask: Tensor[(3), int32], %LAYERTYPE_YOLO106_bias: Tensor[(18), float32], %LAYERTYPE_YOLO106_attr: Tensor[(6), int32], %LAYERTYPE_CONVOLUTIONAL92_weight: Tensor[(512, 256, 3, 3), float32], %LAYERTYPE_CONVOLUTIONAL92_gamma: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL92_beta: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL92_moving_mean: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL92_moving_var: Tensor[(512), float32], %LAYERTYPE_CONVOLUTIONAL93_weight: Tensor[(255, 512, 1, 1), float32], %LAYERTYPE_CONVOLUTIONAL93_bias: Tensor[(255), float32], %LAYERTYPE_YOLO94_mask: Tensor[(3), int32], %LAYERTYPE_YOLO94_bias: Tensor[(18), float32], %LAYERTYPE_YOLO94_attr: Tensor[(6), int32], %LAYERTYPE_CONVOLUTIONAL80_weight: Tensor[(1024, 512, 3, 3), float32], %LAYERTYPE_CONVOLUTIONAL80_gamma: Tensor[(1024), float32], %LAYERTYPE_CONVOLUTIONAL80_beta: Tensor[(1024), float32], %LAYERTYPE_CONVOLUTIONAL80_moving_mean: Tensor[(1024), float32], %LAYERTYPE_CONVOLUTIONAL80_moving_var: Tensor[(1024), float32], %LAYERTYPE_CONVOLUTIONAL81_weight: Tensor[(255, 1024, 1, 1), float32], %LAYERTYPE_CONVOLUTIONAL81_bias: Tensor[(255), float32], %LAYERTYPE_YOLO82_mask: Tensor[(3), int32], %LAYERTYPE_YOLO82_bias: Tensor[(18), float32], %LAYERTYPE_YOLO82_attr: Tensor[(6), int32]) -> (Tensor[(1, 255, 52, 52), float32], Tensor[(3), int32], Tensor[(18), float32], Tensor[(6), int32], Tensor[(1, 255, 26, 26), float32], Tensor[(3), int32], Tensor[(18), float32], Tensor[(6), int32], Tensor[(1, 255, 13, 13), float32], Tensor[(3), int32], Tensor[(18), float32], Tensor[(6), int32]) { + %0 = nn.conv2d(%data, %LAYERTYPE_CONVOLUTIONAL0_weight, padding=[1, 1, 1, 1], channels=32, kernel_size=[3, 3]) /* ty=Tensor[(1, 32, 416, 416), float32] */; + %1 = nn.batch_norm(%0, %LAYERTYPE_CONVOLUTIONAL0_gamma, %LAYERTYPE_CONVOLUTIONAL0_beta, %LAYERTYPE_CONVOLUTIONAL0_moving_mean, %LAYERTYPE_CONVOLUTIONAL0_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 32, 416, 416), float32], Tensor[(32), float32], Tensor[(32), float32]) */; + %2 = %1.0; + %3 = nn.leaky_relu(%2, alpha=0.1f) /* ty=Tensor[(1, 32, 416, 416), float32] */; + %4 = nn.conv2d(%3, %LAYERTYPE_CONVOLUTIONAL1_weight, strides=[2, 2], padding=[1, 1, 1, 1], channels=64, kernel_size=[3, 3]) /* ty=Tensor[(1, 64, 208, 208), float32] */; + %5 = nn.batch_norm(%4, %LAYERTYPE_CONVOLUTIONAL1_gamma, %LAYERTYPE_CONVOLUTIONAL1_beta, %LAYERTYPE_CONVOLUTIONAL1_moving_mean, %LAYERTYPE_CONVOLUTIONAL1_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 64, 208, 208), float32], Tensor[(64), float32], Tensor[(64), float32]) */; + %6 = %5.0; + %7 = nn.leaky_relu(%6, alpha=0.1f) /* ty=Tensor[(1, 64, 208, 208), float32] */; + %8 = nn.conv2d(%7, %LAYERTYPE_CONVOLUTIONAL2_weight, padding=[0, 0, 0, 0], channels=32, kernel_size=[1, 1]) /* ty=Tensor[(1, 32, 208, 208), float32] */; + %9 = nn.batch_norm(%8, %LAYERTYPE_CONVOLUTIONAL2_gamma, %LAYERTYPE_CONVOLUTIONAL2_beta, %LAYERTYPE_CONVOLUTIONAL2_moving_mean, %LAYERTYPE_CONVOLUTIONAL2_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 32, 208, 208), float32], Tensor[(32), float32], Tensor[(32), float32]) */; + %10 = %9.0; + %11 = nn.leaky_relu(%10, alpha=0.1f) /* ty=Tensor[(1, 32, 208, 208), float32] */; + %12 = nn.conv2d(%11, %LAYERTYPE_CONVOLUTIONAL3_weight, padding=[1, 1, 1, 1], channels=64, kernel_size=[3, 3]) /* ty=Tensor[(1, 64, 208, 208), float32] */; + %13 = nn.batch_norm(%12, %LAYERTYPE_CONVOLUTIONAL3_gamma, %LAYERTYPE_CONVOLUTIONAL3_beta, %LAYERTYPE_CONVOLUTIONAL3_moving_mean, %LAYERTYPE_CONVOLUTIONAL3_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 64, 208, 208), float32], Tensor[(64), float32], Tensor[(64), float32]) */; + %14 = %13.0; + %15 = nn.leaky_relu(%14, alpha=0.1f) /* ty=Tensor[(1, 64, 208, 208), float32] */; + %16 = add(%15, %7) /* ty=Tensor[(1, 64, 208, 208), float32] */; + %17 = nn.conv2d(%16, %LAYERTYPE_CONVOLUTIONAL5_weight, strides=[2, 2], padding=[1, 1, 1, 1], channels=128, kernel_size=[3, 3]) /* ty=Tensor[(1, 128, 104, 104), float32] */; + %18 = nn.batch_norm(%17, %LAYERTYPE_CONVOLUTIONAL5_gamma, %LAYERTYPE_CONVOLUTIONAL5_beta, %LAYERTYPE_CONVOLUTIONAL5_moving_mean, %LAYERTYPE_CONVOLUTIONAL5_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 128, 104, 104), float32], Tensor[(128), float32], Tensor[(128), float32]) */; + %19 = %18.0; + %20 = nn.leaky_relu(%19, alpha=0.1f) /* ty=Tensor[(1, 128, 104, 104), float32] */; + %21 = nn.conv2d(%20, %LAYERTYPE_CONVOLUTIONAL6_weight, padding=[0, 0, 0, 0], channels=64, kernel_size=[1, 1]) /* ty=Tensor[(1, 64, 104, 104), float32] */; + %22 = nn.batch_norm(%21, %LAYERTYPE_CONVOLUTIONAL6_gamma, %LAYERTYPE_CONVOLUTIONAL6_beta, %LAYERTYPE_CONVOLUTIONAL6_moving_mean, %LAYERTYPE_CONVOLUTIONAL6_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 64, 104, 104), float32], Tensor[(64), float32], Tensor[(64), float32]) */; + %23 = %22.0; + %24 = nn.leaky_relu(%23, alpha=0.1f) /* ty=Tensor[(1, 64, 104, 104), float32] */; + %25 = nn.conv2d(%24, %LAYERTYPE_CONVOLUTIONAL7_weight, padding=[1, 1, 1, 1], channels=128, kernel_size=[3, 3]) /* ty=Tensor[(1, 128, 104, 104), float32] */; + %26 = nn.batch_norm(%25, %LAYERTYPE_CONVOLUTIONAL7_gamma, %LAYERTYPE_CONVOLUTIONAL7_beta, %LAYERTYPE_CONVOLUTIONAL7_moving_mean, %LAYERTYPE_CONVOLUTIONAL7_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 128, 104, 104), float32], Tensor[(128), float32], Tensor[(128), float32]) */; + %27 = %26.0; + %28 = nn.leaky_relu(%27, alpha=0.1f) /* ty=Tensor[(1, 128, 104, 104), float32] */; + %29 = add(%28, %20) /* ty=Tensor[(1, 128, 104, 104), float32] */; + %30 = nn.conv2d(%29, %LAYERTYPE_CONVOLUTIONAL9_weight, padding=[0, 0, 0, 0], channels=64, kernel_size=[1, 1]) /* ty=Tensor[(1, 64, 104, 104), float32] */; + %31 = nn.batch_norm(%30, %LAYERTYPE_CONVOLUTIONAL9_gamma, %LAYERTYPE_CONVOLUTIONAL9_beta, %LAYERTYPE_CONVOLUTIONAL9_moving_mean, %LAYERTYPE_CONVOLUTIONAL9_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 64, 104, 104), float32], Tensor[(64), float32], Tensor[(64), float32]) */; + %32 = %31.0; + %33 = nn.leaky_relu(%32, alpha=0.1f) /* ty=Tensor[(1, 64, 104, 104), float32] */; + %34 = nn.conv2d(%33, %LAYERTYPE_CONVOLUTIONAL10_weight, padding=[1, 1, 1, 1], channels=128, kernel_size=[3, 3]) /* ty=Tensor[(1, 128, 104, 104), float32] */; + %35 = nn.batch_norm(%34, %LAYERTYPE_CONVOLUTIONAL10_gamma, %LAYERTYPE_CONVOLUTIONAL10_beta, %LAYERTYPE_CONVOLUTIONAL10_moving_mean, %LAYERTYPE_CONVOLUTIONAL10_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 128, 104, 104), float32], Tensor[(128), float32], Tensor[(128), float32]) */; + %36 = %35.0; + %37 = nn.leaky_relu(%36, alpha=0.1f) /* ty=Tensor[(1, 128, 104, 104), float32] */; + %38 = add(%37, %29) /* ty=Tensor[(1, 128, 104, 104), float32] */; + %39 = nn.conv2d(%38, %LAYERTYPE_CONVOLUTIONAL12_weight, strides=[2, 2], padding=[1, 1, 1, 1], channels=256, kernel_size=[3, 3]) /* ty=Tensor[(1, 256, 52, 52), float32] */; + %40 = nn.batch_norm(%39, %LAYERTYPE_CONVOLUTIONAL12_gamma, %LAYERTYPE_CONVOLUTIONAL12_beta, %LAYERTYPE_CONVOLUTIONAL12_moving_mean, %LAYERTYPE_CONVOLUTIONAL12_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 256, 52, 52), float32], Tensor[(256), float32], Tensor[(256), float32]) */; + %41 = %40.0; + %42 = nn.leaky_relu(%41, alpha=0.1f) /* ty=Tensor[(1, 256, 52, 52), float32] */; + %43 = nn.conv2d(%42, %LAYERTYPE_CONVOLUTIONAL13_weight, padding=[0, 0, 0, 0], channels=128, kernel_size=[1, 1]) /* ty=Tensor[(1, 128, 52, 52), float32] */; + %44 = nn.batch_norm(%43, %LAYERTYPE_CONVOLUTIONAL13_gamma, %LAYERTYPE_CONVOLUTIONAL13_beta, %LAYERTYPE_CONVOLUTIONAL13_moving_mean, %LAYERTYPE_CONVOLUTIONAL13_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 128, 52, 52), float32], Tensor[(128), float32], Tensor[(128), float32]) */; + %45 = %44.0; + %46 = nn.leaky_relu(%45, alpha=0.1f) /* ty=Tensor[(1, 128, 52, 52), float32] */; + %47 = nn.conv2d(%46, %LAYERTYPE_CONVOLUTIONAL14_weight, padding=[1, 1, 1, 1], channels=256, kernel_size=[3, 3]) /* ty=Tensor[(1, 256, 52, 52), float32] */; + %48 = nn.batch_norm(%47, %LAYERTYPE_CONVOLUTIONAL14_gamma, %LAYERTYPE_CONVOLUTIONAL14_beta, %LAYERTYPE_CONVOLUTIONAL14_moving_mean, %LAYERTYPE_CONVOLUTIONAL14_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 256, 52, 52), float32], Tensor[(256), float32], Tensor[(256), float32]) */; + %49 = %48.0; + %50 = nn.leaky_relu(%49, alpha=0.1f) /* ty=Tensor[(1, 256, 52, 52), float32] */; + %51 = add(%50, %42) /* ty=Tensor[(1, 256, 52, 52), float32] */; + %52 = nn.conv2d(%51, %LAYERTYPE_CONVOLUTIONAL16_weight, padding=[0, 0, 0, 0], channels=128, kernel_size=[1, 1]) /* ty=Tensor[(1, 128, 52, 52), float32] */; + %53 = nn.batch_norm(%52, %LAYERTYPE_CONVOLUTIONAL16_gamma, %LAYERTYPE_CONVOLUTIONAL16_beta, %LAYERTYPE_CONVOLUTIONAL16_moving_mean, %LAYERTYPE_CONVOLUTIONAL16_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 128, 52, 52), float32], Tensor[(128), float32], Tensor[(128), float32]) */; + %54 = %53.0; + %55 = nn.leaky_relu(%54, alpha=0.1f) /* ty=Tensor[(1, 128, 52, 52), float32] */; + %56 = nn.conv2d(%55, %LAYERTYPE_CONVOLUTIONAL17_weight, padding=[1, 1, 1, 1], channels=256, kernel_size=[3, 3]) /* ty=Tensor[(1, 256, 52, 52), float32] */; + %57 = nn.batch_norm(%56, %LAYERTYPE_CONVOLUTIONAL17_gamma, %LAYERTYPE_CONVOLUTIONAL17_beta, %LAYERTYPE_CONVOLUTIONAL17_moving_mean, %LAYERTYPE_CONVOLUTIONAL17_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 256, 52, 52), float32], Tensor[(256), float32], Tensor[(256), float32]) */; + %58 = %57.0; + %59 = nn.leaky_relu(%58, alpha=0.1f) /* ty=Tensor[(1, 256, 52, 52), float32] */; + %60 = add(%59, %51) /* ty=Tensor[(1, 256, 52, 52), float32] */; + %61 = nn.conv2d(%60, %LAYERTYPE_CONVOLUTIONAL19_weight, padding=[0, 0, 0, 0], channels=128, kernel_size=[1, 1]) /* ty=Tensor[(1, 128, 52, 52), float32] */; + %62 = nn.batch_norm(%61, %LAYERTYPE_CONVOLUTIONAL19_gamma, %LAYERTYPE_CONVOLUTIONAL19_beta, %LAYERTYPE_CONVOLUTIONAL19_moving_mean, %LAYERTYPE_CONVOLUTIONAL19_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 128, 52, 52), float32], Tensor[(128), float32], Tensor[(128), float32]) */; + %63 = %62.0; + %64 = nn.leaky_relu(%63, alpha=0.1f) /* ty=Tensor[(1, 128, 52, 52), float32] */; + %65 = nn.conv2d(%64, %LAYERTYPE_CONVOLUTIONAL20_weight, padding=[1, 1, 1, 1], channels=256, kernel_size=[3, 3]) /* ty=Tensor[(1, 256, 52, 52), float32] */; + %66 = nn.batch_norm(%65, %LAYERTYPE_CONVOLUTIONAL20_gamma, %LAYERTYPE_CONVOLUTIONAL20_beta, %LAYERTYPE_CONVOLUTIONAL20_moving_mean, %LAYERTYPE_CONVOLUTIONAL20_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 256, 52, 52), float32], Tensor[(256), float32], Tensor[(256), float32]) */; + %67 = %66.0; + %68 = nn.leaky_relu(%67, alpha=0.1f) /* ty=Tensor[(1, 256, 52, 52), float32] */; + %69 = add(%68, %60) /* ty=Tensor[(1, 256, 52, 52), float32] */; + %70 = nn.conv2d(%69, %LAYERTYPE_CONVOLUTIONAL22_weight, padding=[0, 0, 0, 0], channels=128, kernel_size=[1, 1]) /* ty=Tensor[(1, 128, 52, 52), float32] */; + %71 = nn.batch_norm(%70, %LAYERTYPE_CONVOLUTIONAL22_gamma, %LAYERTYPE_CONVOLUTIONAL22_beta, %LAYERTYPE_CONVOLUTIONAL22_moving_mean, %LAYERTYPE_CONVOLUTIONAL22_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 128, 52, 52), float32], Tensor[(128), float32], Tensor[(128), float32]) */; + %72 = %71.0; + %73 = nn.leaky_relu(%72, alpha=0.1f) /* ty=Tensor[(1, 128, 52, 52), float32] */; + %74 = nn.conv2d(%73, %LAYERTYPE_CONVOLUTIONAL23_weight, padding=[1, 1, 1, 1], channels=256, kernel_size=[3, 3]) /* ty=Tensor[(1, 256, 52, 52), float32] */; + %75 = nn.batch_norm(%74, %LAYERTYPE_CONVOLUTIONAL23_gamma, %LAYERTYPE_CONVOLUTIONAL23_beta, %LAYERTYPE_CONVOLUTIONAL23_moving_mean, %LAYERTYPE_CONVOLUTIONAL23_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 256, 52, 52), float32], Tensor[(256), float32], Tensor[(256), float32]) */; + %76 = %75.0; + %77 = nn.leaky_relu(%76, alpha=0.1f) /* ty=Tensor[(1, 256, 52, 52), float32] */; + %78 = add(%77, %69) /* ty=Tensor[(1, 256, 52, 52), float32] */; + %79 = nn.conv2d(%78, %LAYERTYPE_CONVOLUTIONAL25_weight, padding=[0, 0, 0, 0], channels=128, kernel_size=[1, 1]) /* ty=Tensor[(1, 128, 52, 52), float32] */; + %80 = nn.batch_norm(%79, %LAYERTYPE_CONVOLUTIONAL25_gamma, %LAYERTYPE_CONVOLUTIONAL25_beta, %LAYERTYPE_CONVOLUTIONAL25_moving_mean, %LAYERTYPE_CONVOLUTIONAL25_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 128, 52, 52), float32], Tensor[(128), float32], Tensor[(128), float32]) */; + %81 = %80.0; + %82 = nn.leaky_relu(%81, alpha=0.1f) /* ty=Tensor[(1, 128, 52, 52), float32] */; + %83 = nn.conv2d(%82, %LAYERTYPE_CONVOLUTIONAL26_weight, padding=[1, 1, 1, 1], channels=256, kernel_size=[3, 3]) /* ty=Tensor[(1, 256, 52, 52), float32] */; + %84 = nn.batch_norm(%83, %LAYERTYPE_CONVOLUTIONAL26_gamma, %LAYERTYPE_CONVOLUTIONAL26_beta, %LAYERTYPE_CONVOLUTIONAL26_moving_mean, %LAYERTYPE_CONVOLUTIONAL26_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 256, 52, 52), float32], Tensor[(256), float32], Tensor[(256), float32]) */; + %85 = %84.0; + %86 = nn.leaky_relu(%85, alpha=0.1f) /* ty=Tensor[(1, 256, 52, 52), float32] */; + %87 = add(%86, %78) /* ty=Tensor[(1, 256, 52, 52), float32] */; + %88 = nn.conv2d(%87, %LAYERTYPE_CONVOLUTIONAL28_weight, padding=[0, 0, 0, 0], channels=128, kernel_size=[1, 1]) /* ty=Tensor[(1, 128, 52, 52), float32] */; + %89 = nn.batch_norm(%88, %LAYERTYPE_CONVOLUTIONAL28_gamma, %LAYERTYPE_CONVOLUTIONAL28_beta, %LAYERTYPE_CONVOLUTIONAL28_moving_mean, %LAYERTYPE_CONVOLUTIONAL28_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 128, 52, 52), float32], Tensor[(128), float32], Tensor[(128), float32]) */; + %90 = %89.0; + %91 = nn.leaky_relu(%90, alpha=0.1f) /* ty=Tensor[(1, 128, 52, 52), float32] */; + %92 = nn.conv2d(%91, %LAYERTYPE_CONVOLUTIONAL29_weight, padding=[1, 1, 1, 1], channels=256, kernel_size=[3, 3]) /* ty=Tensor[(1, 256, 52, 52), float32] */; + %93 = nn.batch_norm(%92, %LAYERTYPE_CONVOLUTIONAL29_gamma, %LAYERTYPE_CONVOLUTIONAL29_beta, %LAYERTYPE_CONVOLUTIONAL29_moving_mean, %LAYERTYPE_CONVOLUTIONAL29_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 256, 52, 52), float32], Tensor[(256), float32], Tensor[(256), float32]) */; + %94 = %93.0; + %95 = nn.leaky_relu(%94, alpha=0.1f) /* ty=Tensor[(1, 256, 52, 52), float32] */; + %96 = add(%95, %87) /* ty=Tensor[(1, 256, 52, 52), float32] */; + %97 = nn.conv2d(%96, %LAYERTYPE_CONVOLUTIONAL31_weight, padding=[0, 0, 0, 0], channels=128, kernel_size=[1, 1]) /* ty=Tensor[(1, 128, 52, 52), float32] */; + %98 = nn.batch_norm(%97, %LAYERTYPE_CONVOLUTIONAL31_gamma, %LAYERTYPE_CONVOLUTIONAL31_beta, %LAYERTYPE_CONVOLUTIONAL31_moving_mean, %LAYERTYPE_CONVOLUTIONAL31_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 128, 52, 52), float32], Tensor[(128), float32], Tensor[(128), float32]) */; + %99 = %98.0; + %100 = nn.leaky_relu(%99, alpha=0.1f) /* ty=Tensor[(1, 128, 52, 52), float32] */; + %101 = nn.conv2d(%100, %LAYERTYPE_CONVOLUTIONAL32_weight, padding=[1, 1, 1, 1], channels=256, kernel_size=[3, 3]) /* ty=Tensor[(1, 256, 52, 52), float32] */; + %102 = nn.batch_norm(%101, %LAYERTYPE_CONVOLUTIONAL32_gamma, %LAYERTYPE_CONVOLUTIONAL32_beta, %LAYERTYPE_CONVOLUTIONAL32_moving_mean, %LAYERTYPE_CONVOLUTIONAL32_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 256, 52, 52), float32], Tensor[(256), float32], Tensor[(256), float32]) */; + %103 = %102.0; + %104 = nn.leaky_relu(%103, alpha=0.1f) /* ty=Tensor[(1, 256, 52, 52), float32] */; + %105 = add(%104, %96) /* ty=Tensor[(1, 256, 52, 52), float32] */; + %106 = nn.conv2d(%105, %LAYERTYPE_CONVOLUTIONAL34_weight, padding=[0, 0, 0, 0], channels=128, kernel_size=[1, 1]) /* ty=Tensor[(1, 128, 52, 52), float32] */; + %107 = nn.batch_norm(%106, %LAYERTYPE_CONVOLUTIONAL34_gamma, %LAYERTYPE_CONVOLUTIONAL34_beta, %LAYERTYPE_CONVOLUTIONAL34_moving_mean, %LAYERTYPE_CONVOLUTIONAL34_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 128, 52, 52), float32], Tensor[(128), float32], Tensor[(128), float32]) */; + %108 = %107.0; + %109 = nn.leaky_relu(%108, alpha=0.1f) /* ty=Tensor[(1, 128, 52, 52), float32] */; + %110 = nn.conv2d(%109, %LAYERTYPE_CONVOLUTIONAL35_weight, padding=[1, 1, 1, 1], channels=256, kernel_size=[3, 3]) /* ty=Tensor[(1, 256, 52, 52), float32] */; + %111 = nn.batch_norm(%110, %LAYERTYPE_CONVOLUTIONAL35_gamma, %LAYERTYPE_CONVOLUTIONAL35_beta, %LAYERTYPE_CONVOLUTIONAL35_moving_mean, %LAYERTYPE_CONVOLUTIONAL35_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 256, 52, 52), float32], Tensor[(256), float32], Tensor[(256), float32]) */; + %112 = %111.0; + %113 = nn.leaky_relu(%112, alpha=0.1f) /* ty=Tensor[(1, 256, 52, 52), float32] */; + %114 = add(%113, %105) /* ty=Tensor[(1, 256, 52, 52), float32] */; + %115 = nn.conv2d(%114, %LAYERTYPE_CONVOLUTIONAL37_weight, strides=[2, 2], padding=[1, 1, 1, 1], channels=512, kernel_size=[3, 3]) /* ty=Tensor[(1, 512, 26, 26), float32] */; + %116 = nn.batch_norm(%115, %LAYERTYPE_CONVOLUTIONAL37_gamma, %LAYERTYPE_CONVOLUTIONAL37_beta, %LAYERTYPE_CONVOLUTIONAL37_moving_mean, %LAYERTYPE_CONVOLUTIONAL37_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 512, 26, 26), float32], Tensor[(512), float32], Tensor[(512), float32]) */; + %117 = %116.0; + %118 = nn.leaky_relu(%117, alpha=0.1f) /* ty=Tensor[(1, 512, 26, 26), float32] */; + %119 = nn.conv2d(%118, %LAYERTYPE_CONVOLUTIONAL38_weight, padding=[0, 0, 0, 0], channels=256, kernel_size=[1, 1]) /* ty=Tensor[(1, 256, 26, 26), float32] */; + %120 = nn.batch_norm(%119, %LAYERTYPE_CONVOLUTIONAL38_gamma, %LAYERTYPE_CONVOLUTIONAL38_beta, %LAYERTYPE_CONVOLUTIONAL38_moving_mean, %LAYERTYPE_CONVOLUTIONAL38_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 256, 26, 26), float32], Tensor[(256), float32], Tensor[(256), float32]) */; + %121 = %120.0; + %122 = nn.leaky_relu(%121, alpha=0.1f) /* ty=Tensor[(1, 256, 26, 26), float32] */; + %123 = nn.conv2d(%122, %LAYERTYPE_CONVOLUTIONAL39_weight, padding=[1, 1, 1, 1], channels=512, kernel_size=[3, 3]) /* ty=Tensor[(1, 512, 26, 26), float32] */; + %124 = nn.batch_norm(%123, %LAYERTYPE_CONVOLUTIONAL39_gamma, %LAYERTYPE_CONVOLUTIONAL39_beta, %LAYERTYPE_CONVOLUTIONAL39_moving_mean, %LAYERTYPE_CONVOLUTIONAL39_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 512, 26, 26), float32], Tensor[(512), float32], Tensor[(512), float32]) */; + %125 = %124.0; + %126 = nn.leaky_relu(%125, alpha=0.1f) /* ty=Tensor[(1, 512, 26, 26), float32] */; + %127 = add(%126, %118) /* ty=Tensor[(1, 512, 26, 26), float32] */; + %128 = nn.conv2d(%127, %LAYERTYPE_CONVOLUTIONAL41_weight, padding=[0, 0, 0, 0], channels=256, kernel_size=[1, 1]) /* ty=Tensor[(1, 256, 26, 26), float32] */; + %129 = nn.batch_norm(%128, %LAYERTYPE_CONVOLUTIONAL41_gamma, %LAYERTYPE_CONVOLUTIONAL41_beta, %LAYERTYPE_CONVOLUTIONAL41_moving_mean, %LAYERTYPE_CONVOLUTIONAL41_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 256, 26, 26), float32], Tensor[(256), float32], Tensor[(256), float32]) */; + %130 = %129.0; + %131 = nn.leaky_relu(%130, alpha=0.1f) /* ty=Tensor[(1, 256, 26, 26), float32] */; + %132 = nn.conv2d(%131, %LAYERTYPE_CONVOLUTIONAL42_weight, padding=[1, 1, 1, 1], channels=512, kernel_size=[3, 3]) /* ty=Tensor[(1, 512, 26, 26), float32] */; + %133 = nn.batch_norm(%132, %LAYERTYPE_CONVOLUTIONAL42_gamma, %LAYERTYPE_CONVOLUTIONAL42_beta, %LAYERTYPE_CONVOLUTIONAL42_moving_mean, %LAYERTYPE_CONVOLUTIONAL42_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 512, 26, 26), float32], Tensor[(512), float32], Tensor[(512), float32]) */; + %134 = %133.0; + %135 = nn.leaky_relu(%134, alpha=0.1f) /* ty=Tensor[(1, 512, 26, 26), float32] */; + %136 = add(%135, %127) /* ty=Tensor[(1, 512, 26, 26), float32] */; + %137 = nn.conv2d(%136, %LAYERTYPE_CONVOLUTIONAL44_weight, padding=[0, 0, 0, 0], channels=256, kernel_size=[1, 1]) /* ty=Tensor[(1, 256, 26, 26), float32] */; + %138 = nn.batch_norm(%137, %LAYERTYPE_CONVOLUTIONAL44_gamma, %LAYERTYPE_CONVOLUTIONAL44_beta, %LAYERTYPE_CONVOLUTIONAL44_moving_mean, %LAYERTYPE_CONVOLUTIONAL44_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 256, 26, 26), float32], Tensor[(256), float32], Tensor[(256), float32]) */; + %139 = %138.0; + %140 = nn.leaky_relu(%139, alpha=0.1f) /* ty=Tensor[(1, 256, 26, 26), float32] */; + %141 = nn.conv2d(%140, %LAYERTYPE_CONVOLUTIONAL45_weight, padding=[1, 1, 1, 1], channels=512, kernel_size=[3, 3]) /* ty=Tensor[(1, 512, 26, 26), float32] */; + %142 = nn.batch_norm(%141, %LAYERTYPE_CONVOLUTIONAL45_gamma, %LAYERTYPE_CONVOLUTIONAL45_beta, %LAYERTYPE_CONVOLUTIONAL45_moving_mean, %LAYERTYPE_CONVOLUTIONAL45_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 512, 26, 26), float32], Tensor[(512), float32], Tensor[(512), float32]) */; + %143 = %142.0; + %144 = nn.leaky_relu(%143, alpha=0.1f) /* ty=Tensor[(1, 512, 26, 26), float32] */; + %145 = add(%144, %136) /* ty=Tensor[(1, 512, 26, 26), float32] */; + %146 = nn.conv2d(%145, %LAYERTYPE_CONVOLUTIONAL47_weight, padding=[0, 0, 0, 0], channels=256, kernel_size=[1, 1]) /* ty=Tensor[(1, 256, 26, 26), float32] */; + %147 = nn.batch_norm(%146, %LAYERTYPE_CONVOLUTIONAL47_gamma, %LAYERTYPE_CONVOLUTIONAL47_beta, %LAYERTYPE_CONVOLUTIONAL47_moving_mean, %LAYERTYPE_CONVOLUTIONAL47_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 256, 26, 26), float32], Tensor[(256), float32], Tensor[(256), float32]) */; + %148 = %147.0; + %149 = nn.leaky_relu(%148, alpha=0.1f) /* ty=Tensor[(1, 256, 26, 26), float32] */; + %150 = nn.conv2d(%149, %LAYERTYPE_CONVOLUTIONAL48_weight, padding=[1, 1, 1, 1], channels=512, kernel_size=[3, 3]) /* ty=Tensor[(1, 512, 26, 26), float32] */; + %151 = nn.batch_norm(%150, %LAYERTYPE_CONVOLUTIONAL48_gamma, %LAYERTYPE_CONVOLUTIONAL48_beta, %LAYERTYPE_CONVOLUTIONAL48_moving_mean, %LAYERTYPE_CONVOLUTIONAL48_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 512, 26, 26), float32], Tensor[(512), float32], Tensor[(512), float32]) */; + %152 = %151.0; + %153 = nn.leaky_relu(%152, alpha=0.1f) /* ty=Tensor[(1, 512, 26, 26), float32] */; + %154 = add(%153, %145) /* ty=Tensor[(1, 512, 26, 26), float32] */; + %155 = nn.conv2d(%154, %LAYERTYPE_CONVOLUTIONAL50_weight, padding=[0, 0, 0, 0], channels=256, kernel_size=[1, 1]) /* ty=Tensor[(1, 256, 26, 26), float32] */; + %156 = nn.batch_norm(%155, %LAYERTYPE_CONVOLUTIONAL50_gamma, %LAYERTYPE_CONVOLUTIONAL50_beta, %LAYERTYPE_CONVOLUTIONAL50_moving_mean, %LAYERTYPE_CONVOLUTIONAL50_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 256, 26, 26), float32], Tensor[(256), float32], Tensor[(256), float32]) */; + %157 = %156.0; + %158 = nn.leaky_relu(%157, alpha=0.1f) /* ty=Tensor[(1, 256, 26, 26), float32] */; + %159 = nn.conv2d(%158, %LAYERTYPE_CONVOLUTIONAL51_weight, padding=[1, 1, 1, 1], channels=512, kernel_size=[3, 3]) /* ty=Tensor[(1, 512, 26, 26), float32] */; + %160 = nn.batch_norm(%159, %LAYERTYPE_CONVOLUTIONAL51_gamma, %LAYERTYPE_CONVOLUTIONAL51_beta, %LAYERTYPE_CONVOLUTIONAL51_moving_mean, %LAYERTYPE_CONVOLUTIONAL51_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 512, 26, 26), float32], Tensor[(512), float32], Tensor[(512), float32]) */; + %161 = %160.0; + %162 = nn.leaky_relu(%161, alpha=0.1f) /* ty=Tensor[(1, 512, 26, 26), float32] */; + %163 = add(%162, %154) /* ty=Tensor[(1, 512, 26, 26), float32] */; + %164 = nn.conv2d(%163, %LAYERTYPE_CONVOLUTIONAL53_weight, padding=[0, 0, 0, 0], channels=256, kernel_size=[1, 1]) /* ty=Tensor[(1, 256, 26, 26), float32] */; + %165 = nn.batch_norm(%164, %LAYERTYPE_CONVOLUTIONAL53_gamma, %LAYERTYPE_CONVOLUTIONAL53_beta, %LAYERTYPE_CONVOLUTIONAL53_moving_mean, %LAYERTYPE_CONVOLUTIONAL53_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 256, 26, 26), float32], Tensor[(256), float32], Tensor[(256), float32]) */; + %166 = %165.0; + %167 = nn.leaky_relu(%166, alpha=0.1f) /* ty=Tensor[(1, 256, 26, 26), float32] */; + %168 = nn.conv2d(%167, %LAYERTYPE_CONVOLUTIONAL54_weight, padding=[1, 1, 1, 1], channels=512, kernel_size=[3, 3]) /* ty=Tensor[(1, 512, 26, 26), float32] */; + %169 = nn.batch_norm(%168, %LAYERTYPE_CONVOLUTIONAL54_gamma, %LAYERTYPE_CONVOLUTIONAL54_beta, %LAYERTYPE_CONVOLUTIONAL54_moving_mean, %LAYERTYPE_CONVOLUTIONAL54_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 512, 26, 26), float32], Tensor[(512), float32], Tensor[(512), float32]) */; + %170 = %169.0; + %171 = nn.leaky_relu(%170, alpha=0.1f) /* ty=Tensor[(1, 512, 26, 26), float32] */; + %172 = add(%171, %163) /* ty=Tensor[(1, 512, 26, 26), float32] */; + %173 = nn.conv2d(%172, %LAYERTYPE_CONVOLUTIONAL56_weight, padding=[0, 0, 0, 0], channels=256, kernel_size=[1, 1]) /* ty=Tensor[(1, 256, 26, 26), float32] */; + %174 = nn.batch_norm(%173, %LAYERTYPE_CONVOLUTIONAL56_gamma, %LAYERTYPE_CONVOLUTIONAL56_beta, %LAYERTYPE_CONVOLUTIONAL56_moving_mean, %LAYERTYPE_CONVOLUTIONAL56_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 256, 26, 26), float32], Tensor[(256), float32], Tensor[(256), float32]) */; + %175 = %174.0; + %176 = nn.leaky_relu(%175, alpha=0.1f) /* ty=Tensor[(1, 256, 26, 26), float32] */; + %177 = nn.conv2d(%176, %LAYERTYPE_CONVOLUTIONAL57_weight, padding=[1, 1, 1, 1], channels=512, kernel_size=[3, 3]) /* ty=Tensor[(1, 512, 26, 26), float32] */; + %178 = nn.batch_norm(%177, %LAYERTYPE_CONVOLUTIONAL57_gamma, %LAYERTYPE_CONVOLUTIONAL57_beta, %LAYERTYPE_CONVOLUTIONAL57_moving_mean, %LAYERTYPE_CONVOLUTIONAL57_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 512, 26, 26), float32], Tensor[(512), float32], Tensor[(512), float32]) */; + %179 = %178.0; + %180 = nn.leaky_relu(%179, alpha=0.1f) /* ty=Tensor[(1, 512, 26, 26), float32] */; + %181 = add(%180, %172) /* ty=Tensor[(1, 512, 26, 26), float32] */; + %182 = nn.conv2d(%181, %LAYERTYPE_CONVOLUTIONAL59_weight, padding=[0, 0, 0, 0], channels=256, kernel_size=[1, 1]) /* ty=Tensor[(1, 256, 26, 26), float32] */; + %183 = nn.batch_norm(%182, %LAYERTYPE_CONVOLUTIONAL59_gamma, %LAYERTYPE_CONVOLUTIONAL59_beta, %LAYERTYPE_CONVOLUTIONAL59_moving_mean, %LAYERTYPE_CONVOLUTIONAL59_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 256, 26, 26), float32], Tensor[(256), float32], Tensor[(256), float32]) */; + %184 = %183.0; + %185 = nn.leaky_relu(%184, alpha=0.1f) /* ty=Tensor[(1, 256, 26, 26), float32] */; + %186 = nn.conv2d(%185, %LAYERTYPE_CONVOLUTIONAL60_weight, padding=[1, 1, 1, 1], channels=512, kernel_size=[3, 3]) /* ty=Tensor[(1, 512, 26, 26), float32] */; + %187 = nn.batch_norm(%186, %LAYERTYPE_CONVOLUTIONAL60_gamma, %LAYERTYPE_CONVOLUTIONAL60_beta, %LAYERTYPE_CONVOLUTIONAL60_moving_mean, %LAYERTYPE_CONVOLUTIONAL60_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 512, 26, 26), float32], Tensor[(512), float32], Tensor[(512), float32]) */; + %188 = %187.0; + %189 = nn.leaky_relu(%188, alpha=0.1f) /* ty=Tensor[(1, 512, 26, 26), float32] */; + %190 = add(%189, %181) /* ty=Tensor[(1, 512, 26, 26), float32] */; + %191 = nn.conv2d(%190, %LAYERTYPE_CONVOLUTIONAL62_weight, strides=[2, 2], padding=[1, 1, 1, 1], channels=1024, kernel_size=[3, 3]) /* ty=Tensor[(1, 1024, 13, 13), float32] */; + %192 = nn.batch_norm(%191, %LAYERTYPE_CONVOLUTIONAL62_gamma, %LAYERTYPE_CONVOLUTIONAL62_beta, %LAYERTYPE_CONVOLUTIONAL62_moving_mean, %LAYERTYPE_CONVOLUTIONAL62_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 1024, 13, 13), float32], Tensor[(1024), float32], Tensor[(1024), float32]) */; + %193 = %192.0; + %194 = nn.leaky_relu(%193, alpha=0.1f) /* ty=Tensor[(1, 1024, 13, 13), float32] */; + %195 = nn.conv2d(%194, %LAYERTYPE_CONVOLUTIONAL63_weight, padding=[0, 0, 0, 0], channels=512, kernel_size=[1, 1]) /* ty=Tensor[(1, 512, 13, 13), float32] */; + %196 = nn.batch_norm(%195, %LAYERTYPE_CONVOLUTIONAL63_gamma, %LAYERTYPE_CONVOLUTIONAL63_beta, %LAYERTYPE_CONVOLUTIONAL63_moving_mean, %LAYERTYPE_CONVOLUTIONAL63_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 512, 13, 13), float32], Tensor[(512), float32], Tensor[(512), float32]) */; + %197 = %196.0; + %198 = nn.leaky_relu(%197, alpha=0.1f) /* ty=Tensor[(1, 512, 13, 13), float32] */; + %199 = nn.conv2d(%198, %LAYERTYPE_CONVOLUTIONAL64_weight, padding=[1, 1, 1, 1], channels=1024, kernel_size=[3, 3]) /* ty=Tensor[(1, 1024, 13, 13), float32] */; + %200 = nn.batch_norm(%199, %LAYERTYPE_CONVOLUTIONAL64_gamma, %LAYERTYPE_CONVOLUTIONAL64_beta, %LAYERTYPE_CONVOLUTIONAL64_moving_mean, %LAYERTYPE_CONVOLUTIONAL64_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 1024, 13, 13), float32], Tensor[(1024), float32], Tensor[(1024), float32]) */; + %201 = %200.0; + %202 = nn.leaky_relu(%201, alpha=0.1f) /* ty=Tensor[(1, 1024, 13, 13), float32] */; + %203 = add(%202, %194) /* ty=Tensor[(1, 1024, 13, 13), float32] */; + %204 = nn.conv2d(%203, %LAYERTYPE_CONVOLUTIONAL66_weight, padding=[0, 0, 0, 0], channels=512, kernel_size=[1, 1]) /* ty=Tensor[(1, 512, 13, 13), float32] */; + %205 = nn.batch_norm(%204, %LAYERTYPE_CONVOLUTIONAL66_gamma, %LAYERTYPE_CONVOLUTIONAL66_beta, %LAYERTYPE_CONVOLUTIONAL66_moving_mean, %LAYERTYPE_CONVOLUTIONAL66_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 512, 13, 13), float32], Tensor[(512), float32], Tensor[(512), float32]) */; + %206 = %205.0; + %207 = nn.leaky_relu(%206, alpha=0.1f) /* ty=Tensor[(1, 512, 13, 13), float32] */; + %208 = nn.conv2d(%207, %LAYERTYPE_CONVOLUTIONAL67_weight, padding=[1, 1, 1, 1], channels=1024, kernel_size=[3, 3]) /* ty=Tensor[(1, 1024, 13, 13), float32] */; + %209 = nn.batch_norm(%208, %LAYERTYPE_CONVOLUTIONAL67_gamma, %LAYERTYPE_CONVOLUTIONAL67_beta, %LAYERTYPE_CONVOLUTIONAL67_moving_mean, %LAYERTYPE_CONVOLUTIONAL67_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 1024, 13, 13), float32], Tensor[(1024), float32], Tensor[(1024), float32]) */; + %210 = %209.0; + %211 = nn.leaky_relu(%210, alpha=0.1f) /* ty=Tensor[(1, 1024, 13, 13), float32] */; + %212 = add(%211, %203) /* ty=Tensor[(1, 1024, 13, 13), float32] */; + %213 = nn.conv2d(%212, %LAYERTYPE_CONVOLUTIONAL69_weight, padding=[0, 0, 0, 0], channels=512, kernel_size=[1, 1]) /* ty=Tensor[(1, 512, 13, 13), float32] */; + %214 = nn.batch_norm(%213, %LAYERTYPE_CONVOLUTIONAL69_gamma, %LAYERTYPE_CONVOLUTIONAL69_beta, %LAYERTYPE_CONVOLUTIONAL69_moving_mean, %LAYERTYPE_CONVOLUTIONAL69_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 512, 13, 13), float32], Tensor[(512), float32], Tensor[(512), float32]) */; + %215 = %214.0; + %216 = nn.leaky_relu(%215, alpha=0.1f) /* ty=Tensor[(1, 512, 13, 13), float32] */; + %217 = nn.conv2d(%216, %LAYERTYPE_CONVOLUTIONAL70_weight, padding=[1, 1, 1, 1], channels=1024, kernel_size=[3, 3]) /* ty=Tensor[(1, 1024, 13, 13), float32] */; + %218 = nn.batch_norm(%217, %LAYERTYPE_CONVOLUTIONAL70_gamma, %LAYERTYPE_CONVOLUTIONAL70_beta, %LAYERTYPE_CONVOLUTIONAL70_moving_mean, %LAYERTYPE_CONVOLUTIONAL70_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 1024, 13, 13), float32], Tensor[(1024), float32], Tensor[(1024), float32]) */; + %219 = %218.0; + %220 = nn.leaky_relu(%219, alpha=0.1f) /* ty=Tensor[(1, 1024, 13, 13), float32] */; + %221 = add(%220, %212) /* ty=Tensor[(1, 1024, 13, 13), float32] */; + %222 = nn.conv2d(%221, %LAYERTYPE_CONVOLUTIONAL72_weight, padding=[0, 0, 0, 0], channels=512, kernel_size=[1, 1]) /* ty=Tensor[(1, 512, 13, 13), float32] */; + %223 = nn.batch_norm(%222, %LAYERTYPE_CONVOLUTIONAL72_gamma, %LAYERTYPE_CONVOLUTIONAL72_beta, %LAYERTYPE_CONVOLUTIONAL72_moving_mean, %LAYERTYPE_CONVOLUTIONAL72_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 512, 13, 13), float32], Tensor[(512), float32], Tensor[(512), float32]) */; + %224 = %223.0; + %225 = nn.leaky_relu(%224, alpha=0.1f) /* ty=Tensor[(1, 512, 13, 13), float32] */; + %226 = nn.conv2d(%225, %LAYERTYPE_CONVOLUTIONAL73_weight, padding=[1, 1, 1, 1], channels=1024, kernel_size=[3, 3]) /* ty=Tensor[(1, 1024, 13, 13), float32] */; + %227 = nn.batch_norm(%226, %LAYERTYPE_CONVOLUTIONAL73_gamma, %LAYERTYPE_CONVOLUTIONAL73_beta, %LAYERTYPE_CONVOLUTIONAL73_moving_mean, %LAYERTYPE_CONVOLUTIONAL73_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 1024, 13, 13), float32], Tensor[(1024), float32], Tensor[(1024), float32]) */; + %228 = %227.0; + %229 = nn.leaky_relu(%228, alpha=0.1f) /* ty=Tensor[(1, 1024, 13, 13), float32] */; + %230 = add(%229, %221) /* ty=Tensor[(1, 1024, 13, 13), float32] */; + %231 = nn.conv2d(%230, %LAYERTYPE_CONVOLUTIONAL75_weight, padding=[0, 0, 0, 0], channels=512, kernel_size=[1, 1]) /* ty=Tensor[(1, 512, 13, 13), float32] */; + %232 = nn.batch_norm(%231, %LAYERTYPE_CONVOLUTIONAL75_gamma, %LAYERTYPE_CONVOLUTIONAL75_beta, %LAYERTYPE_CONVOLUTIONAL75_moving_mean, %LAYERTYPE_CONVOLUTIONAL75_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 512, 13, 13), float32], Tensor[(512), float32], Tensor[(512), float32]) */; + %233 = %232.0; + %234 = nn.leaky_relu(%233, alpha=0.1f) /* ty=Tensor[(1, 512, 13, 13), float32] */; + %235 = nn.conv2d(%234, %LAYERTYPE_CONVOLUTIONAL76_weight, padding=[1, 1, 1, 1], channels=1024, kernel_size=[3, 3]) /* ty=Tensor[(1, 1024, 13, 13), float32] */; + %236 = nn.batch_norm(%235, %LAYERTYPE_CONVOLUTIONAL76_gamma, %LAYERTYPE_CONVOLUTIONAL76_beta, %LAYERTYPE_CONVOLUTIONAL76_moving_mean, %LAYERTYPE_CONVOLUTIONAL76_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 1024, 13, 13), float32], Tensor[(1024), float32], Tensor[(1024), float32]) */; + %237 = %236.0; + %238 = nn.leaky_relu(%237, alpha=0.1f) /* ty=Tensor[(1, 1024, 13, 13), float32] */; + %239 = nn.conv2d(%238, %LAYERTYPE_CONVOLUTIONAL77_weight, padding=[0, 0, 0, 0], channels=512, kernel_size=[1, 1]) /* ty=Tensor[(1, 512, 13, 13), float32] */; + %240 = nn.batch_norm(%239, %LAYERTYPE_CONVOLUTIONAL77_gamma, %LAYERTYPE_CONVOLUTIONAL77_beta, %LAYERTYPE_CONVOLUTIONAL77_moving_mean, %LAYERTYPE_CONVOLUTIONAL77_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 512, 13, 13), float32], Tensor[(512), float32], Tensor[(512), float32]) */; + %241 = %240.0; + %242 = nn.leaky_relu(%241, alpha=0.1f) /* ty=Tensor[(1, 512, 13, 13), float32] */; + %243 = nn.conv2d(%242, %LAYERTYPE_CONVOLUTIONAL78_weight, padding=[1, 1, 1, 1], channels=1024, kernel_size=[3, 3]) /* ty=Tensor[(1, 1024, 13, 13), float32] */; + %244 = nn.batch_norm(%243, %LAYERTYPE_CONVOLUTIONAL78_gamma, %LAYERTYPE_CONVOLUTIONAL78_beta, %LAYERTYPE_CONVOLUTIONAL78_moving_mean, %LAYERTYPE_CONVOLUTIONAL78_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 1024, 13, 13), float32], Tensor[(1024), float32], Tensor[(1024), float32]) */; + %245 = %244.0; + %246 = nn.leaky_relu(%245, alpha=0.1f) /* ty=Tensor[(1, 1024, 13, 13), float32] */; + %247 = nn.conv2d(%246, %LAYERTYPE_CONVOLUTIONAL79_weight, padding=[0, 0, 0, 0], channels=512, kernel_size=[1, 1]) /* ty=Tensor[(1, 512, 13, 13), float32] */; + %248 = nn.batch_norm(%247, %LAYERTYPE_CONVOLUTIONAL79_gamma, %LAYERTYPE_CONVOLUTIONAL79_beta, %LAYERTYPE_CONVOLUTIONAL79_moving_mean, %LAYERTYPE_CONVOLUTIONAL79_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 512, 13, 13), float32], Tensor[(512), float32], Tensor[(512), float32]) */; + %249 = %248.0; + %250 = nn.leaky_relu(%249, alpha=0.1f) /* ty=Tensor[(1, 512, 13, 13), float32] */; + %251 = nn.conv2d(%250, %LAYERTYPE_CONVOLUTIONAL84_weight, padding=[0, 0, 0, 0], channels=256, kernel_size=[1, 1]) /* ty=Tensor[(1, 256, 13, 13), float32] */; + %252 = nn.batch_norm(%251, %LAYERTYPE_CONVOLUTIONAL84_gamma, %LAYERTYPE_CONVOLUTIONAL84_beta, %LAYERTYPE_CONVOLUTIONAL84_moving_mean, %LAYERTYPE_CONVOLUTIONAL84_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 256, 13, 13), float32], Tensor[(256), float32], Tensor[(256), float32]) */; + %253 = %252.0; + %254 = nn.leaky_relu(%253, alpha=0.1f) /* ty=Tensor[(1, 256, 13, 13), float32] */; + %255 = nn.upsampling(%254, scale_h=2f, scale_w=2f) /* ty=Tensor[(1, 256, 26, 26), float32] */; + %256 = (%255, %190); + %257 = concatenate(%256, axis=1) /* ty=Tensor[(1, 768, 26, 26), float32] */; + %258 = nn.conv2d(%257, %LAYERTYPE_CONVOLUTIONAL87_weight, padding=[0, 0, 0, 0], channels=256, kernel_size=[1, 1]) /* ty=Tensor[(1, 256, 26, 26), float32] */; + %259 = nn.batch_norm(%258, %LAYERTYPE_CONVOLUTIONAL87_gamma, %LAYERTYPE_CONVOLUTIONAL87_beta, %LAYERTYPE_CONVOLUTIONAL87_moving_mean, %LAYERTYPE_CONVOLUTIONAL87_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 256, 26, 26), float32], Tensor[(256), float32], Tensor[(256), float32]) */; + %260 = %259.0; + %261 = nn.leaky_relu(%260, alpha=0.1f) /* ty=Tensor[(1, 256, 26, 26), float32] */; + %262 = nn.conv2d(%261, %LAYERTYPE_CONVOLUTIONAL88_weight, padding=[1, 1, 1, 1], channels=512, kernel_size=[3, 3]) /* ty=Tensor[(1, 512, 26, 26), float32] */; + %263 = nn.batch_norm(%262, %LAYERTYPE_CONVOLUTIONAL88_gamma, %LAYERTYPE_CONVOLUTIONAL88_beta, %LAYERTYPE_CONVOLUTIONAL88_moving_mean, %LAYERTYPE_CONVOLUTIONAL88_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 512, 26, 26), float32], Tensor[(512), float32], Tensor[(512), float32]) */; + %264 = %263.0; + %265 = nn.leaky_relu(%264, alpha=0.1f) /* ty=Tensor[(1, 512, 26, 26), float32] */; + %266 = nn.conv2d(%265, %LAYERTYPE_CONVOLUTIONAL89_weight, padding=[0, 0, 0, 0], channels=256, kernel_size=[1, 1]) /* ty=Tensor[(1, 256, 26, 26), float32] */; + %267 = nn.batch_norm(%266, %LAYERTYPE_CONVOLUTIONAL89_gamma, %LAYERTYPE_CONVOLUTIONAL89_beta, %LAYERTYPE_CONVOLUTIONAL89_moving_mean, %LAYERTYPE_CONVOLUTIONAL89_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 256, 26, 26), float32], Tensor[(256), float32], Tensor[(256), float32]) */; + %268 = %267.0; + %269 = nn.leaky_relu(%268, alpha=0.1f) /* ty=Tensor[(1, 256, 26, 26), float32] */; + %270 = nn.conv2d(%269, %LAYERTYPE_CONVOLUTIONAL90_weight, padding=[1, 1, 1, 1], channels=512, kernel_size=[3, 3]) /* ty=Tensor[(1, 512, 26, 26), float32] */; + %271 = nn.batch_norm(%270, %LAYERTYPE_CONVOLUTIONAL90_gamma, %LAYERTYPE_CONVOLUTIONAL90_beta, %LAYERTYPE_CONVOLUTIONAL90_moving_mean, %LAYERTYPE_CONVOLUTIONAL90_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 512, 26, 26), float32], Tensor[(512), float32], Tensor[(512), float32]) */; + %272 = %271.0; + %273 = nn.leaky_relu(%272, alpha=0.1f) /* ty=Tensor[(1, 512, 26, 26), float32] */; + %274 = nn.conv2d(%273, %LAYERTYPE_CONVOLUTIONAL91_weight, padding=[0, 0, 0, 0], channels=256, kernel_size=[1, 1]) /* ty=Tensor[(1, 256, 26, 26), float32] */; + %275 = nn.batch_norm(%274, %LAYERTYPE_CONVOLUTIONAL91_gamma, %LAYERTYPE_CONVOLUTIONAL91_beta, %LAYERTYPE_CONVOLUTIONAL91_moving_mean, %LAYERTYPE_CONVOLUTIONAL91_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 256, 26, 26), float32], Tensor[(256), float32], Tensor[(256), float32]) */; + %276 = %275.0; + %277 = nn.leaky_relu(%276, alpha=0.1f) /* ty=Tensor[(1, 256, 26, 26), float32] */; + %278 = nn.conv2d(%277, %LAYERTYPE_CONVOLUTIONAL96_weight, padding=[0, 0, 0, 0], channels=128, kernel_size=[1, 1]) /* ty=Tensor[(1, 128, 26, 26), float32] */; + %279 = nn.batch_norm(%278, %LAYERTYPE_CONVOLUTIONAL96_gamma, %LAYERTYPE_CONVOLUTIONAL96_beta, %LAYERTYPE_CONVOLUTIONAL96_moving_mean, %LAYERTYPE_CONVOLUTIONAL96_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 128, 26, 26), float32], Tensor[(128), float32], Tensor[(128), float32]) */; + %280 = %279.0; + %281 = nn.leaky_relu(%280, alpha=0.1f) /* ty=Tensor[(1, 128, 26, 26), float32] */; + %282 = nn.upsampling(%281, scale_h=2f, scale_w=2f) /* ty=Tensor[(1, 128, 52, 52), float32] */; + %283 = (%282, %114); + %284 = concatenate(%283, axis=1) /* ty=Tensor[(1, 384, 52, 52), float32] */; + %285 = nn.conv2d(%284, %LAYERTYPE_CONVOLUTIONAL99_weight, padding=[0, 0, 0, 0], channels=128, kernel_size=[1, 1]) /* ty=Tensor[(1, 128, 52, 52), float32] */; + %286 = nn.batch_norm(%285, %LAYERTYPE_CONVOLUTIONAL99_gamma, %LAYERTYPE_CONVOLUTIONAL99_beta, %LAYERTYPE_CONVOLUTIONAL99_moving_mean, %LAYERTYPE_CONVOLUTIONAL99_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 128, 52, 52), float32], Tensor[(128), float32], Tensor[(128), float32]) */; + %287 = %286.0; + %288 = nn.leaky_relu(%287, alpha=0.1f) /* ty=Tensor[(1, 128, 52, 52), float32] */; + %289 = nn.conv2d(%288, %LAYERTYPE_CONVOLUTIONAL100_weight, padding=[1, 1, 1, 1], channels=256, kernel_size=[3, 3]) /* ty=Tensor[(1, 256, 52, 52), float32] */; + %290 = nn.batch_norm(%289, %LAYERTYPE_CONVOLUTIONAL100_gamma, %LAYERTYPE_CONVOLUTIONAL100_beta, %LAYERTYPE_CONVOLUTIONAL100_moving_mean, %LAYERTYPE_CONVOLUTIONAL100_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 256, 52, 52), float32], Tensor[(256), float32], Tensor[(256), float32]) */; + %291 = %290.0; + %292 = nn.leaky_relu(%291, alpha=0.1f) /* ty=Tensor[(1, 256, 52, 52), float32] */; + %293 = nn.conv2d(%292, %LAYERTYPE_CONVOLUTIONAL101_weight, padding=[0, 0, 0, 0], channels=128, kernel_size=[1, 1]) /* ty=Tensor[(1, 128, 52, 52), float32] */; + %294 = nn.batch_norm(%293, %LAYERTYPE_CONVOLUTIONAL101_gamma, %LAYERTYPE_CONVOLUTIONAL101_beta, %LAYERTYPE_CONVOLUTIONAL101_moving_mean, %LAYERTYPE_CONVOLUTIONAL101_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 128, 52, 52), float32], Tensor[(128), float32], Tensor[(128), float32]) */; + %295 = %294.0; + %296 = nn.leaky_relu(%295, alpha=0.1f) /* ty=Tensor[(1, 128, 52, 52), float32] */; + %297 = nn.conv2d(%296, %LAYERTYPE_CONVOLUTIONAL102_weight, padding=[1, 1, 1, 1], channels=256, kernel_size=[3, 3]) /* ty=Tensor[(1, 256, 52, 52), float32] */; + %298 = nn.batch_norm(%297, %LAYERTYPE_CONVOLUTIONAL102_gamma, %LAYERTYPE_CONVOLUTIONAL102_beta, %LAYERTYPE_CONVOLUTIONAL102_moving_mean, %LAYERTYPE_CONVOLUTIONAL102_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 256, 52, 52), float32], Tensor[(256), float32], Tensor[(256), float32]) */; + %299 = %298.0; + %300 = nn.leaky_relu(%299, alpha=0.1f) /* ty=Tensor[(1, 256, 52, 52), float32] */; + %301 = nn.conv2d(%300, %LAYERTYPE_CONVOLUTIONAL103_weight, padding=[0, 0, 0, 0], channels=128, kernel_size=[1, 1]) /* ty=Tensor[(1, 128, 52, 52), float32] */; + %302 = nn.batch_norm(%301, %LAYERTYPE_CONVOLUTIONAL103_gamma, %LAYERTYPE_CONVOLUTIONAL103_beta, %LAYERTYPE_CONVOLUTIONAL103_moving_mean, %LAYERTYPE_CONVOLUTIONAL103_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 128, 52, 52), float32], Tensor[(128), float32], Tensor[(128), float32]) */; + %303 = %302.0; + %304 = nn.leaky_relu(%303, alpha=0.1f) /* ty=Tensor[(1, 128, 52, 52), float32] */; + %305 = nn.conv2d(%304, %LAYERTYPE_CONVOLUTIONAL104_weight, padding=[1, 1, 1, 1], channels=256, kernel_size=[3, 3]) /* ty=Tensor[(1, 256, 52, 52), float32] */; + %306 = nn.batch_norm(%305, %LAYERTYPE_CONVOLUTIONAL104_gamma, %LAYERTYPE_CONVOLUTIONAL104_beta, %LAYERTYPE_CONVOLUTIONAL104_moving_mean, %LAYERTYPE_CONVOLUTIONAL104_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 256, 52, 52), float32], Tensor[(256), float32], Tensor[(256), float32]) */; + %307 = %306.0; + %308 = nn.leaky_relu(%307, alpha=0.1f) /* ty=Tensor[(1, 256, 52, 52), float32] */; + %309 = nn.conv2d(%308, %LAYERTYPE_CONVOLUTIONAL105_weight, padding=[0, 0, 0, 0], channels=255, kernel_size=[1, 1]) /* ty=Tensor[(1, 255, 52, 52), float32] */; + %310 = nn.bias_add(%309, %LAYERTYPE_CONVOLUTIONAL105_bias) /* ty=Tensor[(1, 255, 52, 52), float32] */; + %311 = reshape(%310, newshape=[-1, 3, 85, 52, 52]) /* ty=Tensor[(1, 3, 85, 52, 52), float32] */; + %312 = split(%311, indices_or_sections=[2, 4], axis=2) /* ty=(Tensor[(1, 3, 2, 52, 52), float32], Tensor[(1, 3, 2, 52, 52), float32], Tensor[(1, 3, 81, 52, 52), float32]) */; + %313 = %312.0; + %314 = sigmoid(%313) /* ty=Tensor[(1, 3, 2, 52, 52), float32] */; + %315 = %312.1; + %316 = %312.2; + %317 = sigmoid(%316) /* ty=Tensor[(1, 3, 81, 52, 52), float32] */; + %318 = (%314, %315, %317); + %319 = concatenate(%318, axis=2) /* ty=Tensor[(1, 3, 85, 52, 52), float32] */; + %320 = reshape(%319, newshape=[-1, 255, 52, 52]) /* ty=Tensor[(1, 255, 52, 52), float32] */; + %321 = nn.conv2d(%277, %LAYERTYPE_CONVOLUTIONAL92_weight, padding=[1, 1, 1, 1], channels=512, kernel_size=[3, 3]) /* ty=Tensor[(1, 512, 26, 26), float32] */; + %322 = nn.batch_norm(%321, %LAYERTYPE_CONVOLUTIONAL92_gamma, %LAYERTYPE_CONVOLUTIONAL92_beta, %LAYERTYPE_CONVOLUTIONAL92_moving_mean, %LAYERTYPE_CONVOLUTIONAL92_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 512, 26, 26), float32], Tensor[(512), float32], Tensor[(512), float32]) */; + %323 = %322.0; + %324 = nn.leaky_relu(%323, alpha=0.1f) /* ty=Tensor[(1, 512, 26, 26), float32] */; + %325 = nn.conv2d(%324, %LAYERTYPE_CONVOLUTIONAL93_weight, padding=[0, 0, 0, 0], channels=255, kernel_size=[1, 1]) /* ty=Tensor[(1, 255, 26, 26), float32] */; + %326 = nn.bias_add(%325, %LAYERTYPE_CONVOLUTIONAL93_bias) /* ty=Tensor[(1, 255, 26, 26), float32] */; + %327 = reshape(%326, newshape=[-1, 3, 85, 26, 26]) /* ty=Tensor[(1, 3, 85, 26, 26), float32] */; + %328 = split(%327, indices_or_sections=[2, 4], axis=2) /* ty=(Tensor[(1, 3, 2, 26, 26), float32], Tensor[(1, 3, 2, 26, 26), float32], Tensor[(1, 3, 81, 26, 26), float32]) */; + %329 = %328.0; + %330 = sigmoid(%329) /* ty=Tensor[(1, 3, 2, 26, 26), float32] */; + %331 = %328.1; + %332 = %328.2; + %333 = sigmoid(%332) /* ty=Tensor[(1, 3, 81, 26, 26), float32] */; + %334 = (%330, %331, %333); + %335 = concatenate(%334, axis=2) /* ty=Tensor[(1, 3, 85, 26, 26), float32] */; + %336 = reshape(%335, newshape=[-1, 255, 26, 26]) /* ty=Tensor[(1, 255, 26, 26), float32] */; + %337 = nn.conv2d(%250, %LAYERTYPE_CONVOLUTIONAL80_weight, padding=[1, 1, 1, 1], channels=1024, kernel_size=[3, 3]) /* ty=Tensor[(1, 1024, 13, 13), float32] */; + %338 = nn.batch_norm(%337, %LAYERTYPE_CONVOLUTIONAL80_gamma, %LAYERTYPE_CONVOLUTIONAL80_beta, %LAYERTYPE_CONVOLUTIONAL80_moving_mean, %LAYERTYPE_CONVOLUTIONAL80_moving_var, epsilon=1e-06f) /* ty=(Tensor[(1, 1024, 13, 13), float32], Tensor[(1024), float32], Tensor[(1024), float32]) */; + %339 = %338.0; + %340 = nn.leaky_relu(%339, alpha=0.1f) /* ty=Tensor[(1, 1024, 13, 13), float32] */; + %341 = nn.conv2d(%340, %LAYERTYPE_CONVOLUTIONAL81_weight, padding=[0, 0, 0, 0], channels=255, kernel_size=[1, 1]) /* ty=Tensor[(1, 255, 13, 13), float32] */; + %342 = nn.bias_add(%341, %LAYERTYPE_CONVOLUTIONAL81_bias) /* ty=Tensor[(1, 255, 13, 13), float32] */; + %343 = reshape(%342, newshape=[-1, 3, 85, 13, 13]) /* ty=Tensor[(1, 3, 85, 13, 13), float32] */; + %344 = split(%343, indices_or_sections=[2, 4], axis=2) /* ty=(Tensor[(1, 3, 2, 13, 13), float32], Tensor[(1, 3, 2, 13, 13), float32], Tensor[(1, 3, 81, 13, 13), float32]) */; + %345 = %344.0; + %346 = sigmoid(%345) /* ty=Tensor[(1, 3, 2, 13, 13), float32] */; + %347 = %344.1; + %348 = %344.2; + %349 = sigmoid(%348) /* ty=Tensor[(1, 3, 81, 13, 13), float32] */; + %350 = (%346, %347, %349); + %351 = concatenate(%350, axis=2) /* ty=Tensor[(1, 3, 85, 13, 13), float32] */; + %352 = reshape(%351, newshape=[-1, 255, 13, 13]) /* ty=Tensor[(1, 255, 13, 13), float32] */; + (%320, %LAYERTYPE_YOLO106_mask, %LAYERTYPE_YOLO106_bias, %LAYERTYPE_YOLO106_attr, %336, %LAYERTYPE_YOLO94_mask, %LAYERTYPE_YOLO94_bias, %LAYERTYPE_YOLO94_attr, %352, %LAYERTYPE_YOLO82_mask, %LAYERTYPE_YOLO82_bias, %LAYERTYPE_YOLO82_attr) +} diff --git a/src/codegen.rs b/src/codegen.rs index 84fd1d77bc..f9163d62a5 100644 --- a/src/codegen.rs +++ b/src/codegen.rs @@ -306,7 +306,10 @@ pub fn find_vars(expr: &Expr, id: Id) -> Vec { find_vars_recursive_helper(set, expr, id); } // Box<[Id]> - Language::RelayOperatorCall(ids) | Language::List(ids) | Language::Shape(ids) => { + Language::RelayOperatorCall(ids) + | Language::List(ids) + | Language::Shape(ids) + | Language::ConstructTuple(ids) => { for id in ids.iter() { find_vars_recursive_helper(set, expr, *id); } @@ -324,7 +327,8 @@ pub fn find_vars(expr: &Expr, id: Id) -> Vec { | &Language::ShapeInsertAxis(ids) | &Language::ShapeRemoveAxis(ids) | &Language::AccessShape(ids) - | &Language::AccessSqueeze(ids) => { + | &Language::AccessSqueeze(ids) + | &Language::TupleGetItem(ids) => { for id in ids.iter() { find_vars_recursive_helper(set, expr, *id); } @@ -411,7 +415,10 @@ pub fn generate_worklist_for_codegen(expr: &Expr, id: Id) -> Vec { } } // Box<[Id]> - Language::RelayOperatorCall(ids) | Language::Shape(ids) | Language::List(ids) => { + Language::RelayOperatorCall(ids) + | Language::Shape(ids) + | Language::List(ids) + | Language::ConstructTuple(ids) => { for id in ids.iter() { helper(worklist, expr, *id); } @@ -423,7 +430,8 @@ pub fn generate_worklist_for_codegen(expr: &Expr, id: Id) -> Vec { | &Language::AccessReshape(ids) | &Language::ShapeInsertAxis(ids) | &Language::ShapeRemoveAxis(ids) - | &Language::AccessSqueeze(ids) => { + | &Language::AccessSqueeze(ids) + | &Language::TupleGetItem(ids) => { for id in ids.iter() { helper(worklist, expr, *id); } @@ -1043,6 +1051,12 @@ add_with_broadcasting((float*) {out}, (float*) {X}, (float*) {Y}, (int*) {out_s Some(add_out) } + RelayOperator::RelayLeakyReLU => todo!(), + RelayOperator::RelaySigmoid => todo!(), + RelayOperator::RelayAvgPool2D => todo!(), + RelayOperator::RelayUpSampling => todo!(), + RelayOperator::RelayMaximum => todo!(), + RelayOperator::RelayMinimum => todo!(), } } &Language::AccessWindows([access_id, filters_shape_id, stride_shape_id]) => { @@ -1730,6 +1744,8 @@ if (i{i} < {dim_len}) {{ | Language::RelayOperator(_) => None, &Language::Literal(_) + | &Language::ConstructTuple(_) + | &Language::TupleGetItem(_) | &Language::SystolicArrayConv2dIm2colNchwOihwWithBlocking(_) | &Language::SystolicArrayConv2dIm2colNhwcHwioWithBlocking(_) | &Language::SystolicArrayConv2dNchwOihwWithBlocking(_) @@ -1761,7 +1777,7 @@ mod tests { use ndarray::{SliceInfo, SliceOrIndex}; use ndarray_npy::{read_npy, write_npy}; use ndarray_rand::{rand_distr::Uniform, RandomExt}; - use rand::{rngs::SmallRng, Rng, SeedableRng}; + use rand::{rngs::SmallRng, SeedableRng}; use std::fs::File; use std::io::Write; use std::iter::FromIterator; @@ -1795,7 +1811,9 @@ mod tests { let mut cmd = Command::new("python3"); cmd.arg(script_filepath); + cmd.arg("--npy_out_filepath"); cmd.arg(&output_filepath); + cmd.arg("--npy_arg_filepath"); cmd.stdin(std::process::Stdio::piped()) .stdout(std::process::Stdio::piped()) .stderr(std::process::Stdio::piped()); @@ -1836,6 +1854,90 @@ mod tests { relay_output } + fn run_relay_tuple_out( + env: &HashMap>, + shapes_vec: &Vec<(String, Vec)>, + relay_str: &str, + outputs: usize, + ) -> Vec> { + let script_filepath = format!( + "{}/src/language/from_relay/run_relay.py", + env!("CARGO_MANIFEST_DIR") + ); + + let mut cmd = Command::new("python3"); + cmd.arg(script_filepath); + cmd.arg("--npy_out_filepath"); + let mut output_paths = Vec::new(); + for _ in 0..outputs { + // https://www.reddit.com/r/rust/comments/38jhva/piping_string_to_child_process_stdin/crvlqcd/?utm_source=reddit&utm_medium=web2x&context=3 + // Output filename + // TODO(@gussmith23) Do we want this RNG to use SEED? + // I initially attempted to do this, but was running into issues + // (I think the same filename kept being generated b/c I wasn't + // using the RNG carefully...but maybe there's also something + // wrong w/ how I'm reading files!) + let output_filepath = std::env::temp_dir().with_file_name(format!( + "output-{}.npy", + rand::thread_rng() + .sample_iter(&rand::distributions::Alphanumeric) + .take(30) + .collect::() + )); + cmd.arg(&output_filepath); + output_paths.push( + output_filepath + .clone() + .into_os_string() + .into_string() + .unwrap(), + ); + } + cmd.arg("--npy_arg_filepath"); + cmd.stdin(std::process::Stdio::piped()) + .stdout(std::process::Stdio::piped()) + .stderr(std::process::Stdio::piped()); + for (name, _) in shapes_vec.iter() { + let value = env.get(name).unwrap(); + // TODO(@gussmith23) output type assumption + let filepath = std::env::temp_dir().with_file_name(format!( + "arg-{}.npy", + rand::thread_rng() + .sample_iter(&rand::distributions::Alphanumeric) + .take(30) + .collect::() + )); + write_npy(&filepath, value).unwrap(); + cmd.arg(filepath); + } + + let mut proc = cmd.spawn().ok().expect("Failed to spawn process"); + proc.stdin + .as_mut() + .unwrap() + .write_all(relay_str.as_bytes()) + .unwrap(); + let output = proc.wait_with_output().unwrap(); + // Check that it ran. + assert!( + output.status.success(), + "Running Relay code failed with code {:?}.\nstdout:\n{}\nstderr:\n{}", + output.status.code(), + std::str::from_utf8(output.stdout.as_slice()) + .expect("Could not convert stderr to UTF8"), + std::str::from_utf8(output.stderr.as_slice()) + .expect("Could not convert stderr to UTF8") + ); + + // TODO(@gussmith23) output type assumption + let mut relay_outputs = Vec::new(); + for output_filepath in output_paths.iter() { + let relay_output: ndarray::ArrayD = read_npy(output_filepath).unwrap(); + relay_outputs.push(relay_output); + } + relay_outputs + } + #[test] fn transpose() { let shape = vec![1, 20, 300, 3]; @@ -4042,4 +4144,947 @@ int main() {{ .expect("Could not convert stderr to UTF8") ); } + + #[test] + #[ignore = "unfinished test"] + fn relay_op_leakyrelu() { + let relay = r#" +#[version = "0.0.5"] +def @main(%data: Tensor[(10, 10), float32]) { + nn.leaky_relu(%data, alpha=0.1f) +} +"#; + + let module = tvm::ir::module::IRModule::parse("", relay).unwrap(); + + let (expr, shapes_vec) = crate::language::from_relay::from_relay( + &module, + true, + &vec![crate::language::RelayOperator::RelayLeakyReLU], + ); + + let mut env = HashMap::default(); + let mut value_env = HashMap::default(); + for (k, v) in &shapes_vec { + env.insert(k.clone(), v.clone()); + value_env.insert( + k.clone(), + ndarray::ArrayD::from_shape_vec( + v.clone(), + (0..v.iter().product::()).map(|x| x as f32).collect(), + ) + .unwrap(), + ); + } + + let mut egraph = EGraph::new(MyAnalysis { + name_to_shape: env.clone(), + }); + + let id = egraph.add_expr(&expr); + + let result_output = run_relay(&value_env, &shapes_vec, relay); + + let code = codegen( + &egraph, + id, + &HashMap::default(), + "relay_leakyrelu", + "", + &vec!["data"], + &generate_worklist_for_codegen(&egraph, id), + true, + ); + let main_code = format!( + " +#include +#include +#include \"{}\" + +{} +{} +{} +{} + +int main() {{ + relay_leakyrelu(out, data); + + for (int i = 0; i < {}; i++) {{ + assert(fabs(((float*)result)[i] - ((float*)out)[i]) < 0.00001); + }} +}} +", + PathBuf::from_str( + format!( + "{}/{}/{}", + env!("CARGO_MANIFEST_DIR"), + "c-files", + "relay-op-implementations.c" + ) + .as_str() + ) + .unwrap() + .to_string_lossy(), + c_assignment_string( + "", + "data", + DType::Fp32, + &value_env.get("data").unwrap().view() + ), + c_assignment_string("", "result", DType::Fp32, &result_output.view()), + c_assignment_string( + "", + "out", + DType::Fp32, + &ndarray::ArrayD::::zeros(result_output.shape()).view() + ), + code, + result_output.shape().iter().product::() + ); + + let main_c_filepath = std::env::temp_dir().with_file_name(format!( + "relay-op-leakyrelu-test-{}.c", + std::time::SystemTime::now().elapsed().unwrap().as_nanos() + )); + println!("{}", main_c_filepath.to_string_lossy()); + + let binary_filepath = std::env::temp_dir().with_file_name(format!( + "relay-op-leakyrelu-test-{}", + std::time::SystemTime::now().elapsed().unwrap().as_nanos() + )); + println!("{}", binary_filepath.to_string_lossy()); + + File::create(&main_c_filepath) + .unwrap() + .write_all(main_code.as_bytes()) + .unwrap(); + + let result = Command::new("gcc") + .arg("-Werror") + .arg("-g") + .arg("-o") + .arg(&binary_filepath) + .arg(&main_c_filepath) + .arg("-lm") + .output() + .unwrap(); + + assert!( + result.status.success(), + "{}", + std::str::from_utf8(result.stderr.as_slice()) + .expect("Could not convert stderr to UTF8") + ); + + let result = Command::new(&binary_filepath).output().unwrap(); + + assert!( + result.status.success(), + "{}", + std::str::from_utf8(result.stderr.as_slice()) + .expect("Could not convert stderr to UTF8") + ); + } + + #[test] + #[ignore = "unfinished test"] + fn relay_op_sigmoid() { + let relay = r#" +#[version = "0.0.5"] +def @main(%data: Tensor[(10, 10), float32]) { + sigmoid(%data) +} +"#; + + let module = tvm::ir::module::IRModule::parse("", relay).unwrap(); + + let (expr, shapes_vec) = crate::language::from_relay::from_relay( + &module, + true, + &vec![crate::language::RelayOperator::RelaySigmoid], + ); + + let mut env = HashMap::default(); + let mut value_env = HashMap::default(); + for (k, v) in &shapes_vec { + env.insert(k.clone(), v.clone()); + value_env.insert( + k.clone(), + ndarray::ArrayD::from_shape_vec( + v.clone(), + (0..v.iter().product::()).map(|x| x as f32).collect(), + ) + .unwrap(), + ); + } + + let mut egraph = EGraph::new(MyAnalysis { + name_to_shape: env.clone(), + }); + + let id = egraph.add_expr(&expr); + + let result_output = run_relay(&value_env, &shapes_vec, relay); + + let code = codegen( + &egraph, + id, + &HashMap::default(), + "relay_sigmoid", + "", + &vec!["data"], + &generate_worklist_for_codegen(&egraph, id), + true, + ); + let main_code = format!( + " +#include +#include +#include \"{}\" + +{} +{} +{} +{} + +int main() {{ + relay_sigmoid(out, data); + + for (int i = 0; i < {}; i++) {{ + assert(fabs(((float*)result)[i] - ((float*)out)[i]) < 0.00001); + }} +}} +", + PathBuf::from_str( + format!( + "{}/{}/{}", + env!("CARGO_MANIFEST_DIR"), + "c-files", + "relay-op-implementations.c" + ) + .as_str() + ) + .unwrap() + .to_string_lossy(), + c_assignment_string( + "", + "data", + DType::Fp32, + &value_env.get("data").unwrap().view() + ), + c_assignment_string("", "result", DType::Fp32, &result_output.view()), + c_assignment_string( + "", + "out", + DType::Fp32, + &ndarray::ArrayD::::zeros(result_output.shape()).view() + ), + code, + result_output.shape().iter().product::() + ); + + let main_c_filepath = std::env::temp_dir().with_file_name(format!( + "relay-op-sigmoid-test-{}.c", + std::time::SystemTime::now().elapsed().unwrap().as_nanos() + )); + println!("{}", main_c_filepath.to_string_lossy()); + + let binary_filepath = std::env::temp_dir().with_file_name(format!( + "relay-op-sigmoid-test-{}", + std::time::SystemTime::now().elapsed().unwrap().as_nanos() + )); + println!("{}", binary_filepath.to_string_lossy()); + + File::create(&main_c_filepath) + .unwrap() + .write_all(main_code.as_bytes()) + .unwrap(); + + let result = Command::new("gcc") + .arg("-Werror") + .arg("-g") + .arg("-o") + .arg(&binary_filepath) + .arg(&main_c_filepath) + .arg("-lm") + .output() + .unwrap(); + + assert!( + result.status.success(), + "{}", + std::str::from_utf8(result.stderr.as_slice()) + .expect("Could not convert stderr to UTF8") + ); + + let result = Command::new(&binary_filepath).output().unwrap(); + + assert!( + result.status.success(), + "{}", + std::str::from_utf8(result.stderr.as_slice()) + .expect("Could not convert stderr to UTF8") + ); + } + + #[test] + #[ignore = "unfinished test"] + fn relay_op_avgpool2d() { + let relay = r#" +#[version = "0.0.5"] +def @main(%data: Tensor[(1, 1280, 7, 7), float32]) { + nn.avg_pool2d(%data, pool_size=[7, 7], padding=[0, 0, 0, 0]) +} +"#; + + let module = tvm::ir::module::IRModule::parse("", relay).unwrap(); + + let (expr, shapes_vec) = crate::language::from_relay::from_relay( + &module, + true, + &vec![crate::language::RelayOperator::RelaySigmoid], + ); + + let mut env = HashMap::default(); + let mut value_env = HashMap::default(); + for (k, v) in &shapes_vec { + env.insert(k.clone(), v.clone()); + value_env.insert( + k.clone(), + ndarray::ArrayD::from_shape_vec( + v.clone(), + (0..v.iter().product::()).map(|x| x as f32).collect(), + ) + .unwrap(), + ); + } + + let mut egraph = EGraph::new(MyAnalysis { + name_to_shape: env.clone(), + }); + + let id = egraph.add_expr(&expr); + + let result_output = run_relay(&value_env, &shapes_vec, relay); + + let code = codegen( + &egraph, + id, + &HashMap::default(), + "relay_avgpool2d", + "", + &vec!["data"], + &generate_worklist_for_codegen(&egraph, id), + true, + ); + let main_code = format!( + " +#include +#include +#include \"{}\" + +{} +{} +{} +{} + +int main() {{ + relay_avgpool2d(out, data); + + for (int i = 0; i < {}; i++) {{ + assert(fabs(((float*)result)[i] - ((float*)out)[i]) < 0.00001); + }} +}} +", + PathBuf::from_str( + format!( + "{}/{}/{}", + env!("CARGO_MANIFEST_DIR"), + "c-files", + "relay-op-implementations.c" + ) + .as_str() + ) + .unwrap() + .to_string_lossy(), + c_assignment_string( + "", + "data", + DType::Fp32, + &value_env.get("data").unwrap().view() + ), + c_assignment_string("", "result", DType::Fp32, &result_output.view()), + c_assignment_string( + "", + "out", + DType::Fp32, + &ndarray::ArrayD::::zeros(result_output.shape()).view() + ), + code, + result_output.shape().iter().product::() + ); + + let main_c_filepath = std::env::temp_dir().with_file_name(format!( + "relay-op-avgpool2d-test-{}.c", + std::time::SystemTime::now().elapsed().unwrap().as_nanos() + )); + println!("{}", main_c_filepath.to_string_lossy()); + + let binary_filepath = std::env::temp_dir().with_file_name(format!( + "relay-op-avgpool2d-test-{}", + std::time::SystemTime::now().elapsed().unwrap().as_nanos() + )); + println!("{}", binary_filepath.to_string_lossy()); + + File::create(&main_c_filepath) + .unwrap() + .write_all(main_code.as_bytes()) + .unwrap(); + + let result = Command::new("gcc") + .arg("-Werror") + .arg("-g") + .arg("-o") + .arg(&binary_filepath) + .arg(&main_c_filepath) + .arg("-lm") + .output() + .unwrap(); + + assert!( + result.status.success(), + "{}", + std::str::from_utf8(result.stderr.as_slice()) + .expect("Could not convert stderr to UTF8") + ); + + let result = Command::new(&binary_filepath).output().unwrap(); + + assert!( + result.status.success(), + "{}", + std::str::from_utf8(result.stderr.as_slice()) + .expect("Could not convert stderr to UTF8") + ); + } + + #[test] + #[ignore = "unfinished test"] + fn relay_op_upsampling() { + let relay = r#" +#[version = "0.0.5"] +def @main(%data: Tensor[(1, 256, 13, 13), float32]) { + nn.upsampling(%data, scale_h=2f, scale_w=2f) +} +"#; + + let module = tvm::ir::module::IRModule::parse("", relay).unwrap(); + + let (expr, shapes_vec) = crate::language::from_relay::from_relay( + &module, + true, + &vec![crate::language::RelayOperator::RelaySigmoid], + ); + + let mut env = HashMap::default(); + let mut value_env = HashMap::default(); + for (k, v) in &shapes_vec { + env.insert(k.clone(), v.clone()); + value_env.insert( + k.clone(), + ndarray::ArrayD::from_shape_vec( + v.clone(), + (0..v.iter().product::()).map(|x| x as f32).collect(), + ) + .unwrap(), + ); + } + + let mut egraph = EGraph::new(MyAnalysis { + name_to_shape: env.clone(), + }); + + let id = egraph.add_expr(&expr); + + let result_output = run_relay(&value_env, &shapes_vec, relay); + + let code = codegen( + &egraph, + id, + &HashMap::default(), + "relay_upsampling", + "", + &vec!["data"], + &generate_worklist_for_codegen(&egraph, id), + true, + ); + let main_code = format!( + " +#include +#include +#include \"{}\" + +{} +{} +{} +{} + +int main() {{ + relay_upsampling(out, data); + + for (int i = 0; i < {}; i++) {{ + assert(fabs(((float*)result)[i] - ((float*)out)[i]) < 0.00001); + }} +}} +", + PathBuf::from_str( + format!( + "{}/{}/{}", + env!("CARGO_MANIFEST_DIR"), + "c-files", + "relay-op-implementations.c" + ) + .as_str() + ) + .unwrap() + .to_string_lossy(), + c_assignment_string( + "", + "data", + DType::Fp32, + &value_env.get("data").unwrap().view() + ), + c_assignment_string("", "result", DType::Fp32, &result_output.view()), + c_assignment_string( + "", + "out", + DType::Fp32, + &ndarray::ArrayD::::zeros(result_output.shape()).view() + ), + code, + result_output.shape().iter().product::() + ); + + let main_c_filepath = std::env::temp_dir().with_file_name(format!( + "relay-op-upsampling-test-{}.c", + std::time::SystemTime::now().elapsed().unwrap().as_nanos() + )); + println!("{}", main_c_filepath.to_string_lossy()); + + let binary_filepath = std::env::temp_dir().with_file_name(format!( + "relay-op-upsampling-test-{}", + std::time::SystemTime::now().elapsed().unwrap().as_nanos() + )); + println!("{}", binary_filepath.to_string_lossy()); + + File::create(&main_c_filepath) + .unwrap() + .write_all(main_code.as_bytes()) + .unwrap(); + + let result = Command::new("gcc") + .arg("-Werror") + .arg("-g") + .arg("-o") + .arg(&binary_filepath) + .arg(&main_c_filepath) + .arg("-lm") + .output() + .unwrap(); + + assert!( + result.status.success(), + "{}", + std::str::from_utf8(result.stderr.as_slice()) + .expect("Could not convert stderr to UTF8") + ); + + let result = Command::new(&binary_filepath).output().unwrap(); + + assert!( + result.status.success(), + "{}", + std::str::from_utf8(result.stderr.as_slice()) + .expect("Could not convert stderr to UTF8") + ); + } + + #[test] + #[ignore = "unfinished test"] + fn relay_op_maximum() { + let relay = r#" +#[version = "0.0.5"] +def @main(%x: Tensor[(1, 256, 13, 13), float32], %y: Tensor[(1, 256), float32]) { + maximum(%x, %y) +} +"#; + + let module = tvm::ir::module::IRModule::parse("", relay).unwrap(); + + let (expr, shapes_vec) = crate::language::from_relay::from_relay( + &module, + true, + &vec![crate::language::RelayOperator::RelaySigmoid], + ); + + let mut env = HashMap::default(); + let mut value_env = HashMap::default(); + for (k, v) in &shapes_vec { + env.insert(k.clone(), v.clone()); + value_env.insert( + k.clone(), + ndarray::ArrayD::from_shape_vec( + v.clone(), + (0..v.iter().product::()).map(|x| x as f32).collect(), + ) + .unwrap(), + ); + } + + let mut egraph = EGraph::new(MyAnalysis { + name_to_shape: env.clone(), + }); + + let id = egraph.add_expr(&expr); + + let result_output = run_relay(&value_env, &shapes_vec, relay); + + let code = codegen( + &egraph, + id, + &HashMap::default(), + "relay_maximum", + "", + &vec!["x", "y"], + &generate_worklist_for_codegen(&egraph, id), + true, + ); + let main_code = format!( + " +#include +#include +#include \"{}\" + +{} +{} +{} +{} +{} + +int main() {{ + relay_maximum(out, x, y); + + for (int i = 0; i < {}; i++) {{ + assert(fabs(((float*)result)[i] - ((float*)out)[i]) < 0.00001); + }} +}} +", + PathBuf::from_str( + format!( + "{}/{}/{}", + env!("CARGO_MANIFEST_DIR"), + "c-files", + "relay-op-implementations.c" + ) + .as_str() + ) + .unwrap() + .to_string_lossy(), + c_assignment_string("", "x", DType::Fp32, &value_env.get("x").unwrap().view()), + c_assignment_string("", "y", DType::Fp32, &value_env.get("y").unwrap().view()), + c_assignment_string("", "result", DType::Fp32, &result_output.view()), + c_assignment_string( + "", + "out", + DType::Fp32, + &ndarray::ArrayD::::zeros(result_output.shape()).view() + ), + code, + result_output.shape().iter().product::() + ); + + let main_c_filepath = std::env::temp_dir().with_file_name(format!( + "relay-op-maximum-test-{}.c", + std::time::SystemTime::now().elapsed().unwrap().as_nanos() + )); + println!("{}", main_c_filepath.to_string_lossy()); + + let binary_filepath = std::env::temp_dir().with_file_name(format!( + "relay-op-maximum-test-{}", + std::time::SystemTime::now().elapsed().unwrap().as_nanos() + )); + println!("{}", binary_filepath.to_string_lossy()); + + File::create(&main_c_filepath) + .unwrap() + .write_all(main_code.as_bytes()) + .unwrap(); + + let result = Command::new("gcc") + .arg("-Werror") + .arg("-g") + .arg("-o") + .arg(&binary_filepath) + .arg(&main_c_filepath) + .arg("-lm") + .output() + .unwrap(); + + assert!( + result.status.success(), + "{}", + std::str::from_utf8(result.stderr.as_slice()) + .expect("Could not convert stderr to UTF8") + ); + + let result = Command::new(&binary_filepath).output().unwrap(); + + assert!( + result.status.success(), + "{}", + std::str::from_utf8(result.stderr.as_slice()) + .expect("Could not convert stderr to UTF8") + ); + } + + #[test] + #[ignore = "unfinished test"] + fn relay_op_minimum() { + let relay = r#" +#[version = "0.0.5"] +def @main(%x: Tensor[(1, 256, 13, 13), float32], %y: Tensor[(1, 256), float32]) { + minimum(%x, %y) +} +"#; + + let module = tvm::ir::module::IRModule::parse("", relay).unwrap(); + + let (expr, shapes_vec) = crate::language::from_relay::from_relay( + &module, + true, + &vec![crate::language::RelayOperator::RelaySigmoid], + ); + + let mut env = HashMap::default(); + let mut value_env = HashMap::default(); + for (k, v) in &shapes_vec { + env.insert(k.clone(), v.clone()); + value_env.insert( + k.clone(), + ndarray::ArrayD::from_shape_vec( + v.clone(), + (0..v.iter().product::()).map(|x| x as f32).collect(), + ) + .unwrap(), + ); + } + + let mut egraph = EGraph::new(MyAnalysis { + name_to_shape: env.clone(), + }); + + let id = egraph.add_expr(&expr); + + let result_output = run_relay(&value_env, &shapes_vec, relay); + + let code = codegen( + &egraph, + id, + &HashMap::default(), + "relay_minimum", + "", + &vec!["x", "y"], + &generate_worklist_for_codegen(&egraph, id), + true, + ); + let main_code = format!( + " +#include +#include +#include \"{}\" + +{} +{} +{} +{} +{} + +int main() {{ + relay_minimum(out, x, y); + + for (int i = 0; i < {}; i++) {{ + assert(fabs(((float*)result)[i] - ((float*)out)[i]) < 0.00001); + }} +}} +", + PathBuf::from_str( + format!( + "{}/{}/{}", + env!("CARGO_MANIFEST_DIR"), + "c-files", + "relay-op-implementations.c" + ) + .as_str() + ) + .unwrap() + .to_string_lossy(), + c_assignment_string("", "x", DType::Fp32, &value_env.get("x").unwrap().view()), + c_assignment_string("", "y", DType::Fp32, &value_env.get("y").unwrap().view()), + c_assignment_string("", "result", DType::Fp32, &result_output.view()), + c_assignment_string( + "", + "out", + DType::Fp32, + &ndarray::ArrayD::::zeros(result_output.shape()).view() + ), + code, + result_output.shape().iter().product::() + ); + + let main_c_filepath = std::env::temp_dir().with_file_name(format!( + "relay-op-minimum-test-{}.c", + std::time::SystemTime::now().elapsed().unwrap().as_nanos() + )); + println!("{}", main_c_filepath.to_string_lossy()); + + let binary_filepath = std::env::temp_dir().with_file_name(format!( + "relay-op-minimum-test-{}", + std::time::SystemTime::now().elapsed().unwrap().as_nanos() + )); + println!("{}", binary_filepath.to_string_lossy()); + + File::create(&main_c_filepath) + .unwrap() + .write_all(main_code.as_bytes()) + .unwrap(); + + let result = Command::new("gcc") + .arg("-Werror") + .arg("-g") + .arg("-o") + .arg(&binary_filepath) + .arg(&main_c_filepath) + .arg("-lm") + .output() + .unwrap(); + + assert!( + result.status.success(), + "{}", + std::str::from_utf8(result.stderr.as_slice()) + .expect("Could not convert stderr to UTF8") + ); + + let result = Command::new(&binary_filepath).output().unwrap(); + + assert!( + result.status.success(), + "{}", + std::str::from_utf8(result.stderr.as_slice()) + .expect("Could not convert stderr to UTF8") + ); + } + + #[test] + #[ignore = "unfinished test"] + fn relay_model_yolov3() { + // Generate yolov3 with directions from: + // https://tvm.apache.org/docs/tutorials/frontend/from_darknet.html + let filename = PathBuf::from(format!( + "{}/models/yolov3.relay", + env!("CARGO_MANIFEST_DIR") + )); + let relay = std::fs::read_to_string(&filename).unwrap(); + const SEED: u64 = 23; + let mut tensor_rng = SmallRng::seed_from_u64(SEED); + + let module = tvm::ir::module::IRModule::parse("", relay.clone()).unwrap(); + let (expr, shapes_vec) = crate::language::from_relay::from_relay( + &module, + true, + &vec![ + crate::language::RelayOperator::RelayBatchNormInference, + crate::language::RelayOperator::RelaySoftmax, + crate::language::RelayOperator::RelayLeakyReLU, + crate::language::RelayOperator::RelayBiasAdd, + crate::language::RelayOperator::RelayAdd, + crate::language::RelayOperator::RelaySigmoid, + crate::language::RelayOperator::RelayUpSampling, + ], + ); + let mut env = HashMap::default(); + let mut value_env = HashMap::default(); + for (k, v) in &shapes_vec { + env.insert(k.clone(), v.clone()); + value_env.insert( + k.clone(), + ndarray::ArrayD::::random_using( + v.clone(), + Uniform::new(-2f32, 2f32), + &mut tensor_rng, + ), + ); + } + + let mut egraph = EGraph::new(MyAnalysis { + name_to_shape: env.clone(), + }); + + let _id = egraph.add_expr(&expr); + + let _result = run_relay_tuple_out(&value_env, &shapes_vec, &relay, 12); + todo!("unfinished test") + } + + #[test] + #[ignore = "unfinished test"] + fn relay_model_efficientnet_lite4_11() { + // efficientnet onnx model source: https://github.com/onnx/models/blob/master/vision/classification/efficientnet-lite4/model/efficientnet-lite4-11.onnx + // imported into relay + let filename = PathBuf::from(format!( + "{}/models/efficientnet-lite4-11.relay", + env!("CARGO_MANIFEST_DIR") + )); + let relay = std::fs::read_to_string(&filename).unwrap(); + const SEED: u64 = 23; + let mut tensor_rng = SmallRng::seed_from_u64(SEED); + + let module = tvm::ir::module::IRModule::parse("", relay.clone()).unwrap(); + let (expr, shapes_vec) = crate::language::from_relay::from_relay( + &module, + true, + &vec![ + crate::language::RelayOperator::RelayBatchNormInference, + crate::language::RelayOperator::RelaySoftmax, + crate::language::RelayOperator::RelayLeakyReLU, + crate::language::RelayOperator::RelayBiasAdd, + crate::language::RelayOperator::RelayAdd, + crate::language::RelayOperator::RelayMaximum, + crate::language::RelayOperator::RelayMinimum, + crate::language::RelayOperator::RelayAvgPool2D, + ], + ); + let mut env = HashMap::default(); + let mut value_env = HashMap::default(); + for (k, v) in &shapes_vec { + env.insert(k.clone(), v.clone()); + value_env.insert( + k.clone(), + ndarray::ArrayD::::random_using( + v.clone(), + Uniform::new(-2f32, 2f32), + &mut tensor_rng, + ), + ); + } + + let mut egraph = EGraph::new(MyAnalysis { + name_to_shape: env.clone(), + }); + + let _id = egraph.add_expr(&expr); + + let _result = run_relay(&value_env, &shapes_vec, &relay); + todo!("unfinished test") + } } diff --git a/src/extraction/ilp.rs b/src/extraction/ilp.rs index 9427840123..33d910f137 100644 --- a/src/extraction/ilp.rs +++ b/src/extraction/ilp.rs @@ -20,7 +20,7 @@ use std::collections::hash_map::DefaultHasher; use std::collections::HashMap; use std::hash::{Hash, Hasher}; -use egg::{Id, Language as LangugeTrait}; +use egg::{Id, Language as LanguageTrait}; use rplex::Variable; use rplex::VariableType; use rplex::{var, Constraint, ConstraintType, Env, Problem, VariableValue, WeightedVariable}; @@ -31,6 +31,8 @@ type EGraph = egg::EGraph; pub fn filter_by_enode_type(enode: &Language, _eclass_id: Id, _egraph: &EGraph) -> bool { if match enode { + Language::ConstructTuple(_) + | Language::TupleGetItem(_) => todo!(), // Things we should never see. Language::CartesianProduct(_) @@ -109,6 +111,8 @@ pub fn filter_obviously_less_preferable_nodes( ) -> bool { fn is_obviously_extractable(enode: &Language) -> bool { match enode { + Language::ConstructTuple(_) | Language::TupleGetItem(_) => todo!(), + // Things we should never see. Language::CartesianProduct(_) | Language::MapDotProduct(_) diff --git a/src/extraction/mod.rs b/src/extraction/mod.rs index c2a917975a..eb443fc512 100644 --- a/src/extraction/mod.rs +++ b/src/extraction/mod.rs @@ -69,6 +69,8 @@ impl egg::CostFunction for MonolithicCostFunction<'_> { | Language::SystolicArray(_) | Language::SystolicArrayWithBlocking(_) | Language::Usize(_) + | Language::ConstructTuple(_) + | Language::TupleGetItem(_) | Language::AccessSlice(_) | Language::AccessConcatenate(_) | Language::AccessPad(_) @@ -99,7 +101,7 @@ impl egg::CostFunction for MonolithicCostFunction<'_> { | Language::Compute(_) | Language::AccessTranspose(_) => 1, - // Penalaize specific compute types. In the future, these constructs + // Penalize specific compute types. In the future, these constructs // shouldn't be extractable at all. // TODO(@gussmith23) We shouldn't have to extract ANY computes! Language::ComputeType(t) => match t { @@ -173,6 +175,8 @@ impl CostFunction for SimpleCostFunction { Language::SystolicArrayConv2dNhwcHwioWithBlocking(_) => todo!(), Language::SystolicArrayConv2dIm2colNchwOihwWithBlocking(_) => todo!(), Language::SystolicArrayConv2dIm2colNhwcHwioWithBlocking(_) => todo!(), + Language::ConstructTuple(_) => todo!(), + Language::TupleGetItem(_) => todo!(), // Cannot extract compute: compute must be lowered to an atom. Compute(_) => std::usize::MAX, diff --git a/src/language/from_relay/mod.rs b/src/language/from_relay/mod.rs index 48423de130..41999e8f31 100644 --- a/src/language/from_relay/mod.rs +++ b/src/language/from_relay/mod.rs @@ -4,7 +4,7 @@ use crate::language::Language; use egg::{Id, RecExpr}; use ordered_float::NotNan; -use std::collections::HashMap; +use std::collections::{HashMap, HashSet}; use std::convert::TryInto; use tvm::ir::module::*; use tvm::ir::relay::*; @@ -464,10 +464,10 @@ pub fn shape_from_type(t: tvm::ir::ty::Type) -> Vec { *t.upcast::() ) }); - assert_eq!( - tensor_type.dtype.clone(), - "float32".parse().unwrap(), - "only supporting float32x1 at the moment" + assert!( + tensor_type.dtype.clone() == "float32".parse().unwrap() + || tensor_type.dtype.clone() == "int32".parse().unwrap(), + "only supporting float32x1 and int32x1 at the moment" ); let mut shape = Vec::::default(); for j in 0..tensor_type.shape.len() { @@ -508,7 +508,7 @@ pub fn from_relay( use_opaque_operators_for: &Vec, ) -> (RecExpr, Vec<(String, Vec)>) { let main = module - .lookup(module.get_global_var("main".to_string().into()).unwrap()) + .lookup(module.get_global_var("main").unwrap()) .unwrap(); let func = main.downcast::().unwrap(); let mut names_and_shapes = Vec::default(); @@ -519,7 +519,8 @@ pub fn from_relay( } let mut glenside_expr = RecExpr::default(); let mut worklist = Vec::default(); - create_worklist(func.body.clone(), &mut worklist); + let mut visited = HashSet::new(); + create_worklist(func.body.clone(), &mut worklist, &mut visited); let mut map = HashMap::new(); for expr in worklist { map.insert( @@ -547,28 +548,41 @@ pub fn from_relay( /// so we first recursively generate a worklist which we can then iterate over. /// The main goal of the worklist is to make sure an expression comes *after* /// its children in the worklist; otherwise, we can't compile the expression! -fn create_worklist(relay_expr: Expr, worklist: &mut Vec) { - fn add_to_worklist(expr: Expr, worklist: &mut Vec) { - if !worklist.contains(&expr) { - worklist.push(expr.clone()); - } +/// +/// To prevent redundant recursion which made large expressions prohibitively slow, +/// we keep track of the already visited Expr with "visited", and return if we have already +/// traversed an expression. +fn create_worklist(relay_expr: Expr, worklist: &mut Vec, visited: &mut HashSet) { + if visited.contains(&relay_expr) { + return; + } else { + visited.insert(relay_expr.clone()); } + if let Ok(_var) = relay_expr.clone().downcast::() { - add_to_worklist(relay_expr.clone(), worklist); } else if let Ok(_constant) = relay_expr.clone().downcast::() { - add_to_worklist(relay_expr.clone(), worklist); } else if let Ok(call) = relay_expr.clone().downcast::() { for i in 0..call.args.len() { // Recursively add children (and their dependencies) to the worklist - create_worklist(call.args.get(i.try_into().unwrap()).unwrap(), worklist); + create_worklist( + call.args.get(i.try_into().unwrap()).unwrap(), + worklist, + visited, + ); } - add_to_worklist(relay_expr.clone(), worklist); } else if let Ok(tuple_get_item) = relay_expr .clone() .downcast::() { - create_worklist(tuple_get_item.tuple.clone(), worklist); - add_to_worklist(relay_expr.clone(), worklist); + create_worklist(tuple_get_item.tuple.clone(), worklist, visited); + } else if let Ok(tuple) = relay_expr.clone().downcast::() { + for i in 0..tuple.fields.len() { + create_worklist( + tuple.fields.get(i.try_into().unwrap()).unwrap(), + worklist, + visited, + ); + } } else { // NOTE: if you're hitting this TODO, it might be that you have not // actually implemented the TVM Rust bindings for the Relay construct @@ -577,6 +591,8 @@ fn create_worklist(relay_expr: Expr, worklist: &mut Vec) { // work! todo!("Not implemented: {:?}", tvm::ir::as_text(relay_expr)) } + // add current node to worklist + worklist.push(relay_expr.clone()); } /// Compile a Relay expression to a Glenside [`RecExpr`] @@ -655,29 +671,50 @@ fn compile_expression( .clone() .downcast::() { - // We've only implemented tuple functionality for handling batch norms, - // at the moment. So we check to make sure this is handling a batch - // norm. - - let arg = tuple_get_item + if let Ok(call) = tuple_get_item .tuple .clone() .downcast::() - .unwrap(); - assert_eq!( - arg.op - .clone() - .upcast::() - .downcast::() - .unwrap() - .name - .as_str(), - Ok("nn.batch_norm") - ); - assert_eq!(tuple_get_item.index, 0); + { + // For batch norms, we use a hack where if + // simplify_batch_norm_for_inference_hack is set, + // we compile the Relay batch norm to a single output. + + // All other expressions are compiled using Language::TupleGetItem construct + + if simplify_batch_norm_for_inference_hack + && call + .op + .clone() + .upcast::() + .downcast::() + .unwrap() + .name + .as_str() + .unwrap() + == "nn.batch_norm" + && tuple_get_item.index == 0 + { + // special case: compile Relay batch norm to a single output + return get_compiled_expression(tuple_get_item.tuple.clone()); + } + } + // common case: Relay TupleGetItem gets converted to Glenside TupleGetItem + // handles if tuple is not a CallNode let data_id = get_compiled_expression(tuple_get_item.tuple.clone()); - data_id + let index_id = glenside_expr.add(Language::Usize(tuple_get_item.index as usize)); + glenside_expr.add(Language::TupleGetItem([data_id, index_id])) + } else if let Ok(tuple) = relay_expr.clone().downcast::() { + let mut fields = Vec::new(); + + for i in 0..tuple.fields.len() { + fields.push(get_compiled_expression( + tuple.fields.get(i as isize).unwrap(), + )) + } + + glenside_expr.add(Language::ConstructTuple(Box::from(fields.as_slice()))) } else if let Ok(call) = relay_expr.clone().downcast::() { if let Ok(primitive_op) = call .op @@ -809,6 +846,29 @@ fn compile_expression( compute(glenside_expr, ComputeType::ReLU, data_id) } } + "nn.leaky_relu" => { + assert_eq!(call.args.len(), 1); + let attrs = call + .attrs + .clone() + .downcast::() + .unwrap(); + let data_id = get_compiled_expression(call.args.get(0).unwrap()); + let alpha_id = glenside_expr + .add(Language::NotNanFloat64(NotNan::new(attrs.alpha).unwrap())); + if use_opaque_operators_for + .contains(&crate::language::RelayOperator::RelayLeakyReLU) + { + let leaky_relu_id = glenside_expr.add(Language::RelayOperator( + crate::language::RelayOperator::RelayLeakyReLU, + )); + glenside_expr.add(Language::RelayOperatorCall( + vec![leaky_relu_id, data_id, alpha_id].into_boxed_slice(), + )) + } else { + todo!(); + } + } "sqrt" | "negative" => { assert_eq!(call.args.len(), 1); let data_id = get_compiled_expression(call.args.get(0).unwrap()); @@ -1166,7 +1226,7 @@ fn compile_expression( glenside_expr.add(Language::AccessCartesianProduct([data_id, weights_id])); compute(glenside_expr, ComputeType::DotProduct, data_id) } - "add" | "multiply" | "divide" => { + "add" | "multiply" | "divide" | "maximum" | "minimum" => { assert_eq!(call.args.len(), 2); let mut a_id = get_compiled_expression(call.args.get(0).unwrap()); let mut a_shape = @@ -1186,6 +1246,28 @@ fn compile_expression( vec![add_operator_id, a_id, b_id].into_boxed_slice(), )); } + if primitive_op.name.as_str().unwrap() == "maximum" + && use_opaque_operators_for + .contains(&crate::language::RelayOperator::RelayMaximum) + { + let add_operator_id = glenside_expr.add(Language::RelayOperator( + crate::language::RelayOperator::RelayMaximum, + )); + return glenside_expr.add(Language::RelayOperatorCall( + vec![add_operator_id, a_id, b_id].into_boxed_slice(), + )); + } + if primitive_op.name.as_str().unwrap() == "minimum" + && use_opaque_operators_for + .contains(&crate::language::RelayOperator::RelayMinimum) + { + let add_operator_id = glenside_expr.add(Language::RelayOperator( + crate::language::RelayOperator::RelayMinimum, + )); + return glenside_expr.add(Language::RelayOperatorCall( + vec![add_operator_id, a_id, b_id].into_boxed_slice(), + )); + } while a_shape.len() < b_shape.len() { a_id = access_insert_axis(glenside_expr, a_id, 0); @@ -1472,6 +1554,348 @@ fn compile_expression( attrs.out_layout.as_str().unwrap(), ) } + "nn.upsampling" => { + assert_eq!(call.args.len(), 1); + let attrs = call + .attrs + .clone() + .downcast::() + .unwrap(); + assert_eq!(attrs.layout.as_str().unwrap(), "NCHW"); + let data_id = get_compiled_expression(call.args.get(0).unwrap()); + let scale_h_id = glenside_expr + .add(Language::NotNanFloat64(NotNan::new(attrs.scale_h).unwrap())); + let scale_w_id = glenside_expr + .add(Language::NotNanFloat64(NotNan::new(attrs.scale_w).unwrap())); + let layout_id = match attrs.layout.as_str().unwrap() { + "NCHW" => glenside_expr.add(Language::RelayActivationLayout( + crate::language::RelayActivationLayout::NCHW, + )), + "NHWC" => glenside_expr.add(Language::RelayActivationLayout( + crate::language::RelayActivationLayout::NHWC, + )), + l @ _ => panic!("Unsupported layout: {}", l), + }; + if use_opaque_operators_for + .contains(&crate::language::RelayOperator::RelayUpSampling) + { + let upsampling_id = glenside_expr.add(Language::RelayOperator( + crate::language::RelayOperator::RelayUpSampling, + )); + glenside_expr.add(Language::RelayOperatorCall( + vec![upsampling_id, data_id, scale_h_id, scale_w_id, layout_id] + .into_boxed_slice(), + )) + } else { + todo!() + } + } + "concatenate" => { + assert_eq!(call.args.len(), 1); + let attrs = call + .attrs + .clone() + .downcast::() + .unwrap(); + + assert!(attrs.axis >= 0); + + let tuple = call + .args + .get(0) + .unwrap() + .clone() + .downcast::() + .ok() + .unwrap(); + let mut concatted_id = get_compiled_expression(tuple.fields.get(0).unwrap()); + for i in 1..tuple.fields.len() { + // TODO(@gussmith23) Layout assumption + let to_be_concatted_id = get_compiled_expression( + tuple.fields.get(i.try_into().ok().unwrap()).unwrap(), + ); + concatted_id = access_concatenate( + glenside_expr, + concatted_id, + to_be_concatted_id, + attrs.axis as usize, + ); + } + + concatted_id + } + "reshape" => { + assert_eq!(call.args.len(), 1); + let data_id = get_compiled_expression(call.args.get(0).unwrap()); + + // use relay type information to calculate new shape instead of using attrs + let new_shape = + shape_from_type(call.clone().upcast::().checked_type.clone()); + let new_shape_id = access_shape(glenside_expr, &new_shape, &[]); + + glenside_expr.add(Language::AccessReshape([data_id, new_shape_id])) + } + "split" => { + assert_eq!(call.args.len(), 1); + let attrs = call + .attrs + .clone() + .downcast::() + .unwrap(); + let data_id = get_compiled_expression(call.args.get(0).unwrap()); + + let axis = attrs.axis; + assert!(axis >= 0); + let axis_id = glenside_expr.add(Language::Usize(axis.try_into().unwrap())); + + let indices_or_sections = &attrs + .indices_or_sections + .clone() + .downcast::>() + .unwrap(); + // assume for yolov3 + assert_eq!(indices_or_sections.len(), 2); + + let shape = shape_from_type(call.args.get(0).unwrap().checked_type.clone()); + + let mut ids = Vec::default(); + let zero_id = glenside_expr.add(Language::Usize(0)); + let zero_index_id = glenside_expr.add(Language::Usize( + indices_or_sections + .get(0) + .unwrap() + .downcast::() + .unwrap() + .value as usize, + )); + ids.push(glenside_expr.add(Language::AccessSlice([ + data_id, + axis_id, + zero_id, + zero_index_id, + ]))); + + for i in 0..indices_or_sections.len() - 1 { + let left = glenside_expr.add(Language::Usize( + indices_or_sections + .get(i.try_into().ok().unwrap()) + .unwrap() + .downcast::() + .unwrap() + .value as usize, + )); + let right = glenside_expr.add(Language::Usize( + indices_or_sections + .get((i + 1).try_into().ok().unwrap()) + .unwrap() + .downcast::() + .unwrap() + .value as usize, + )); + ids.push( + glenside_expr + .add(Language::AccessSlice([data_id, axis_id, left, right])), + ); + } + + let last_index_id = glenside_expr.add(Language::Usize( + indices_or_sections + .get((indices_or_sections.len() - 1).try_into().ok().unwrap()) + .unwrap() + .downcast::() + .unwrap() + .value as usize, + )); + let last_id = glenside_expr.add(Language::Usize(shape[axis as usize])); + ids.push(glenside_expr.add(Language::AccessSlice([ + data_id, + axis_id, + last_index_id, + last_id, + ]))); + + glenside_expr.add(Language::ConstructTuple(Box::from(ids.as_slice()))) + } + "sigmoid" => { + assert_eq!(call.args.len(), 1); + let data_id = get_compiled_expression(call.args.get(0).unwrap()); + + if use_opaque_operators_for + .contains(&crate::language::RelayOperator::RelaySigmoid) + { + let sigmoid_id = glenside_expr.add(Language::RelayOperator( + crate::language::RelayOperator::RelaySigmoid, + )); + glenside_expr.add(Language::RelayOperatorCall( + vec![sigmoid_id, data_id].into_boxed_slice(), + )) + } else { + todo!() + } + } + "transpose" => { + assert_eq!(call.args.len(), 1); + let data_id = get_compiled_expression(call.args.get(0).unwrap()); + + let attrs = call + .attrs + .clone() + .downcast::() + .unwrap(); + let transpose_list = attrs + .axes + .clone() + .into_iter() + .map(|x| x.downcast::().unwrap().value as usize) + .collect::>(); + access_transpose(glenside_expr, data_id, &transpose_list) + } + "nn.avg_pool2d" => { + assert_eq!(call.args.len(), 1); + let data_id = get_compiled_expression(call.args.get(0).unwrap()); + + let attrs = call + .attrs + .clone() + .downcast::() + .unwrap(); + + // assume for efficientnet + assert_eq!(attrs.ceil_mode, false); + assert_eq!(attrs.count_include_pad, false); + + assert_eq!(attrs.pool_size.len(), 2); + assert_eq!(attrs.padding.len(), 4); + assert_eq!(attrs.strides.len(), 2); + + let pool_size_id = shape( + glenside_expr, + vec![ + attrs + .pool_size + .get(0) + .unwrap() + .downcast::() + .unwrap() + .value as usize, + attrs + .pool_size + .get(1) + .unwrap() + .downcast::() + .unwrap() + .value as usize, + ], + ); + let padding_id = shape( + glenside_expr, + vec![ + attrs + .padding + .get(0) + .unwrap() + .downcast::() + .unwrap() + .value as usize, + attrs + .padding + .get(1) + .unwrap() + .downcast::() + .unwrap() + .value as usize, + attrs + .padding + .get(2) + .unwrap() + .downcast::() + .unwrap() + .value as usize, + attrs + .padding + .get(3) + .unwrap() + .downcast::() + .unwrap() + .value as usize, + ], + ); + let strides_id = shape( + glenside_expr, + vec![ + attrs + .strides + .get(0) + .unwrap() + .downcast::() + .unwrap() + .value as usize, + attrs + .strides + .get(1) + .unwrap() + .downcast::() + .unwrap() + .value as usize, + ], + ); + let layout_id = match attrs.layout.as_str().unwrap() { + "NCHW" => glenside_expr.add(Language::RelayActivationLayout( + crate::language::RelayActivationLayout::NCHW, + )), + "NHWC" => glenside_expr.add(Language::RelayActivationLayout( + crate::language::RelayActivationLayout::NHWC, + )), + l @ _ => panic!("Unsupported layout: {}", l), + }; + if use_opaque_operators_for + .contains(&crate::language::RelayOperator::RelayAvgPool2D) + { + let avg_pool2d_id = glenside_expr.add(Language::RelayOperator( + crate::language::RelayOperator::RelayAvgPool2D, + )); + glenside_expr.add(Language::RelayOperatorCall( + vec![ + avg_pool2d_id, + data_id, + pool_size_id, + strides_id, + padding_id, + layout_id, + ] + .into_boxed_slice(), + )) + } else { + todo!() + } + } + "squeeze" => { + assert_eq!(call.args.len(), 1); + let mut data_id = get_compiled_expression(call.args.get(0).unwrap()); + + let attrs = call + .attrs + .clone() + .downcast::() + .unwrap(); + + // assume for efficientnet + assert_eq!(attrs.axis.len(), 2); + for i in (0..attrs.axis.len()).rev() { + let usize_id = glenside_expr.add(Language::Usize( + attrs + .axis + .get(i.try_into().ok().unwrap()) + .unwrap() + .downcast::() + .unwrap() + .value as usize, + )); + data_id = glenside_expr.add(Language::AccessSqueeze([data_id, usize_id])); + } + + data_id + } _ => todo!(), } } else { @@ -1587,7 +2011,9 @@ mod tests { if $optional_arg.len() > 0 { cmd.arg($optional_arg); } + cmd.arg("--npy_out_filepath"); cmd.arg(&output_filepath); + cmd.arg("--npy_arg_filepath"); cmd.stdin(std::process::Stdio::piped()) .stdout(std::process::Stdio::piped()) .stderr(std::process::Stdio::piped()); @@ -2128,4 +2554,177 @@ def @main(%x: Tensor[(3), float32]) -> Tensor[(3), float32] { (compute softmax (access (compute softmax (access (access-tensor x) 0)) 0)) "# ); + + test!( + concatenate, + 1e-7, + r#" +#[version = "0.0.5"] +def @main(%x: Tensor[(1, 5, 1, 1), float32], %y: Tensor[(1, 3, 1, 1), float32]) { + %0 = (%x, %y); + concatenate(%0, axis=1) +} +"#, + r#" +(access-concatenate (access-tensor x) (access-tensor y) 1) +"# + ); + + // TODO: Uncomment out this test when reshape is implemented for the interpreter + // Note: the #[ignore] doesn't work because it has to go after #[test] + // and moving #[test] out of the macro causes dead code warnings! + // + // + // #[ignore = "reshape not implemented for interpreter"] + // test!( + // reshape, + // 1e-7, + // r#" + // #[version = "0.0.5"] + // def @main(%x: Tensor[(1, 255, 52, 52), float32]) { + // reshape(%x, newshape=[-1, 3, 85, 52, 52]) + // } + // "#, + // r#" + // (access-reshape (access-tensor x) (access-shape (shape 1 3 85 52 52) (shape ))) + // "# + // ); + + // TODO: add tuple output support to test macro + // and need someway to handle tuples in interpreter + // + // test!( + // split, + // 1e-7, + // r#" + // #[version = "0.0.5"] + // def @main(%x: Tensor[(1, 6, 1), float32]) { + // split(%x, indices_or_sections=[2, 4], axis=1) + // } + // "#, + // r#" + // (construct-tuple + // (access-slice (access-tensor x) 1 0 2) + // (access-slice (access-tensor x) 1 2 4) + // (access-slice (access-tensor x) 1 4 6) + // ) + // "# + // ); + + test!( + transpose, + 1e-7, + r#" +#[version = "0.0.5"] +def @main(%x: Tensor[(3, 5), float32]) { + transpose(%x, axes=[1, 0]) +} +"#, + r#" +(access-transpose (access-tensor x) (list 1 0)) + "# + ); + + test!( + squeeze, + 1e-7, + r#" +#[version = "0.0.5"] +def @main(%x: Tensor[(1, 100, 1, 1), float32]) { + squeeze(%x, axis=[2, 3]) +} +"#, + r#" +(access-squeeze (access-squeeze (access-tensor x) 3) 2) + "# + ); + + // TODO: uncomment these tests once + // from_relay can parse these relay operators without using the opaque relay op hack + // and when the interpreter supports the operations + // test!( + // leakyrelu, + // 1e-7, + // r#" + // #[version = "0.0.5"] + // def @main(%x: Tensor[(1, 100, 1, 1), float32]) { + // nn.leaky_relu(%x, alpha=0.1f) + // } + // "#, + // r#" + // (relay-operator-call relay-leaky-relu (access-tensor x) 0.1) + // "# + // ); + + // test!( + // maximum, + // 1e-7, + // r#" + // #[version = "0.0.5"] + // def @main(%x: Tensor[(1, 100, 5, 1), float32], %y: Tensor[(1, 100), float32]) { + // maximum(%x, %y) + // } + // "#, + // r#" + // (relay-operator-call relay-maximum (access-tensor x) (access-tensor y)) + // "# + // ); + + // test!( + // minimum, + // 1e-7, + // r#" + // #[version = "0.0.5"] + // def @main(%x: Tensor[(1, 100, 5, 1), float32], %y: Tensor[(1, 100), float32]) { + // minimum(%x, %y) + // } + // "#, + // r#" + // (relay-operator-call relay-minimum (access-tensor x) (access-tensor y)) + // "# + // ); + + // test!( + // upsampling, + // 1e-7, + // r#" + // #[version = "0.0.5"] + // def @main(%data: Tensor[(1, 256, 13, 13), float32]) { + // nn.upsampling(%data, scale_h=2f, scale_w=2f) + // } + // "#, + // r#" + // (relay-operator-call relay-upsampling (access-tensor data) 2 2 relay-activation-layout-nchw) + // "# + // ); + + // test!( + // sigmoid, + // 1e-7, + // r#" + // #[version = "0.0.5"] + // def @main(%data: Tensor[(10, 10), float32]) { + // sigmoid(%data) + // } + // "#, + // r#" + // (relay-operator-call relay-sigmoid (access-tensor data)) + // "# + // ); + + // test!( + // avg_pool2d, + // 1e-7, + // r#" + // #[version = "0.0.5"] + // def @main(%data: Tensor[(1, 1280, 7, 7), float32]) { + // nn.avg_pool2d(%data, pool_size=[7, 7], padding=[0, 0, 0, 0]) + // } + // "#, + // r#" + // (relay-operator-call relay-avg-pool2d (access-tensor data) + // (shape 7 7) (shape 1 1) (shape 0 0 0 0) + // relay-activation-layout-nchw) + // "# + // ); } diff --git a/src/language/from_relay/run_relay.py b/src/language/from_relay/run_relay.py index 3186e7ed41..1f710ebcf4 100644 --- a/src/language/from_relay/run_relay.py +++ b/src/language/from_relay/run_relay.py @@ -12,13 +12,12 @@ action='store_true', help='Temporary band-aid b/c nn.dense Relay parser is broken') parser.add_argument('--relay_filepath', - nargs=1, type=argparse.FileType('rb'), default=sys.stdin) -parser.add_argument('npy_out_filepath', type=argparse.FileType('wb')) -parser.add_argument('npy_arg_filepath', - nargs='*', - type=argparse.FileType('rb')) +parser.add_argument('--npy_out_filepath', + nargs='*') +parser.add_argument('--npy_arg_filepath', + nargs='*') parsed = parser.parse_args() @@ -31,7 +30,24 @@ relay_in = parsed.relay_filepath.read() expr = tvm.parser.fromtext(relay_in) -inputs = [np.load(arg_file) for arg_file in parsed.npy_arg_filepath] -output = relay.create_executor(mod=expr).evaluate()(*inputs).asnumpy() +# iteratively open/close files instead of using `type=` +# argument in argparse to prevent opening too many files at the same time +# and causing the test to fail +inputs = [] +for filepath in parsed.npy_arg_filepath: + with open(filepath, 'rb') as arg_file: + inputs.append(np.load(arg_file)) -np.save(parsed.npy_out_filepath, output) +# need graph runtime or crashes for yolo +output = relay.create_executor(mod=expr, kind="graph").evaluate()(*inputs) + +if type(output) is list: + assert len(output) == len(parsed.npy_out_filepath) + for i in range(len(parsed.npy_out_filepath)): + filepath = parsed.npy_out_filepath[i] + with open(filepath, "wb"): + np.save(filepath, output[i].asnumpy().astype('float32')) +else: + filepath = parsed.npy_out_filepath[0] + with open(filepath, "wb"): + np.save(filepath, output.asnumpy().astype('float32')) \ No newline at end of file diff --git a/src/language/interpreter.rs b/src/language/interpreter.rs index e7a338f7f8..56b9a11040 100644 --- a/src/language/interpreter.rs +++ b/src/language/interpreter.rs @@ -83,6 +83,8 @@ where &Language::RelayOperator(_) => todo!(), &Language::RelayActivationLayout(_) => todo!(), &Language::RelayKernelLayout(_) => todo!(), + &Language::ConstructTuple(_) => todo!(), + &Language::TupleGetItem(_) => todo!(), &Language::AccessShape([shape_id, item_shape_id]) => { let shape = match interpret(expr, shape_id.into(), env) { Value::Shape(s) => s, diff --git a/src/language/language.rs b/src/language/language.rs index c57da9247a..73e18aee37 100644 --- a/src/language/language.rs +++ b/src/language/language.rs @@ -202,6 +202,14 @@ define_language! { // List literal "list" = List(Box<[Id]>), + // (construct-tuple ...) + // Tuple Construction + "construct-tuple" = ConstructTuple(Box<[Id]>), + + // (tuple-get-item ) + // Get the item at the ith index of tuple + "tuple-get-item" = TupleGetItem([Id;2]), + // (access-shape ) // Access shape literal. "access-shape" = AccessShape([Id;2]), @@ -305,6 +313,9 @@ pub enum RelayOperator { /// (relay-operator relay-relu ) RelayReLU, + /// (relay-operator relay-leaky-relu ) + RelayLeakyReLU, + /// (relay-operator relay-max-pool2d /// /// ) @@ -314,6 +325,15 @@ pub enum RelayOperator { /// ) RelayGlobalAvgPool2D, + /// (relay-operator relay-avg-pool2d + /// + /// ) + RelayAvgPool2D, + + /// (relay-operator relay-upsampling + /// ) + RelayUpSampling, + /// (relay-operator relay-batch-flatten ) RelayBatchFlatten, @@ -323,6 +343,15 @@ pub enum RelayOperator { /// (relay-operator relay-add ) RelayAdd, + + /// (relay-operator relay-sigmoid ) + RelaySigmoid, + + /// (relay-operator relay-maximum ) + RelayMaximum, + + /// (relay-operator relay-minimum ) + RelayMinimum, } impl FromStr for RelayOperator { type Err = (); @@ -336,6 +365,12 @@ impl FromStr for RelayOperator { "relay-batch-flatten" => Ok(RelayOperator::RelayBatchFlatten), "relay-bias-add" => Ok(RelayOperator::RelayBiasAdd), "relay-add" => Ok(RelayOperator::RelayAdd), + "relay-sigmoid" => Ok(RelayOperator::RelaySigmoid), + "relay-avg-pool2d" => Ok(RelayOperator::RelayAvgPool2D), + "relay-upsampling" => Ok(RelayOperator::RelayUpSampling), + "relay-maximum" => Ok(RelayOperator::RelayMaximum), + "relay-minimum" => Ok(RelayOperator::RelayMinimum), + "relay-leaky-relu" => Ok(RelayOperator::RelayLeakyReLU), _ => Err(()), } } @@ -349,11 +384,17 @@ impl Display for RelayOperator { RelayOperator::RelayBatchNormInference => "relay-batch-norm-inference", RelayOperator::RelaySoftmax => "relay-softmax", RelayOperator::RelayReLU => "relay-relu", + RelayOperator::RelayLeakyReLU => "relay-leaky-relu", RelayOperator::RelayMaxPool2D => "relay-max-pool2d", RelayOperator::RelayGlobalAvgPool2D => "relay-global-avg-pool2d", RelayOperator::RelayBatchFlatten => "relay-batch-flatten", RelayOperator::RelayBiasAdd => "relay-bias-add", RelayOperator::RelayAdd => "relay-add", + RelayOperator::RelaySigmoid => "relay-sigmoid", + RelayOperator::RelayAvgPool2D => "relay-avg-pool2d", + RelayOperator::RelayUpSampling => "relay-upsampling", + RelayOperator::RelayMaximum => "relay-maximum", + RelayOperator::RelayMinimum => "relay-minimum", } ) } @@ -523,6 +564,7 @@ pub enum MyAnalysisData { Legacy(MyAnalysisDataLegacyData), AccessPattern(AccessPatternData), Shape(ShapeData), + Tuple(Vec), // TODO(@gussmith23) Needed? //Tensor(TensorData), ComputeType(ComputeType), @@ -1363,6 +1405,21 @@ impl egg::Analysis for MyAnalysis { } RelayActivationLayout(l) => MyAnalysisData::RelayActivationLayout(l.clone()), RelayKernelLayout(l) => MyAnalysisData::RelayKernelLayout(l.clone()), + ConstructTuple(ids) => { + let tuple_shape = ids + .iter() + .map(|id| (&egraph[*id].data).clone()) + .collect::>(); + MyAnalysisData::Tuple(tuple_shape) + } + TupleGetItem(ids) => { + let index = MyAnalysis::get_usize(ids[1], egraph); + let data = match &egraph[ids[0]].data { + MyAnalysisData::Tuple(x) => x, + _ => panic!(), + }; + data[index].clone() + } RelayOperator(op) => MyAnalysisData::RelayOperator(op.clone()), RelayOperatorCall(params) => { assert!(params.len() > 0); @@ -1373,7 +1430,9 @@ impl egg::Analysis for MyAnalysis { }; match op_type { - crate::language::RelayOperator::RelayAdd => { + crate::language::RelayOperator::RelayAdd + | crate::language::RelayOperator::RelayMaximum + | crate::language::RelayOperator::RelayMinimum => { let (a, b) = match params[1..] .iter() .map(|id| &egraph[*id].data) @@ -1599,6 +1658,48 @@ impl egg::Analysis for MyAnalysis { MyAnalysisData::AccessPattern(access) } + crate::language::RelayOperator::RelayLeakyReLU => { + let mut access = match params[1..] + .iter() + .map(|id| &egraph[*id].data) + .collect::>()[..] + { + [MyAnalysisData::AccessPattern(a), MyAnalysisData::Literal(_)] => { + a.clone() + } + _ => panic!("Parameters do not type check"), + }; + + if !access.zero_regions.is_empty() { + debug!( + "Throwing away zero region analysis data on line {}", + std::line!() + ); + } + access.zero_regions = HashMap::default(); + + MyAnalysisData::AccessPattern(access) + } + crate::language::RelayOperator::RelaySigmoid => { + let mut access = match params[1..] + .iter() + .map(|id| &egraph[*id].data) + .collect::>()[..] + { + [MyAnalysisData::AccessPattern(a)] => a.clone(), + _ => panic!("Parameters do not type check"), + }; + + if !access.zero_regions.is_empty() { + debug!( + "Throwing away zero region analysis data on line {}", + std::line!() + ); + } + access.zero_regions = HashMap::default(); + + MyAnalysisData::AccessPattern(access) + } crate::language::RelayOperator::RelaySoftmax => { let mut access = match params[1..] .iter() @@ -1641,6 +1742,119 @@ impl egg::Analysis for MyAnalysis { } access.zero_regions = HashMap::default(); + MyAnalysisData::AccessPattern(access) + } + crate::language::RelayOperator::RelayAvgPool2D => { + let (mut access, pool_size, strides, padding, layout) = match params[1..] + .iter() + .map(|id| &egraph[*id].data) + .collect::>()[..] + { + [MyAnalysisData::AccessPattern(a), MyAnalysisData::Shape(pool_size), MyAnalysisData::Shape(strides), MyAnalysisData::Shape(padding), MyAnalysisData::RelayActivationLayout(l)] => { + (a.clone(), pool_size, strides, padding, l) + } + _ => panic!("Parameters do not type check"), + }; + + if !access.zero_regions.is_empty() { + debug!( + "Throwing away zero region analysis data on line {}", + std::line!() + ); + } + access.zero_regions = HashMap::default(); + + assert_eq!(access.shape.ndim() + access.item_shape.ndim(), 4); + assert_eq!(pool_size.shape.ndim(), 2); + assert_eq!(strides.shape.ndim(), 2); + assert_eq!(padding.shape.ndim(), 4); + + match layout { + crate::language::RelayActivationLayout::NCHW => { + // Sorry for the horrific indentation... + access[2] = + // The dimension plus padding + (((padding.shape[0] + access[2] + padding.shape[2]) + // Get the number of spots where we could pool + - (pool_size.shape[0] - 1)) + // Then calculate the spots we actually pool at + // using the stride + + strides.shape[0] + - 1) + / strides.shape[0]; + access[3] = (((padding.shape[1] + access[3] + padding.shape[3]) + // Get the number of spots where we could pool + - (pool_size.shape[1] - 1)) + // Then calculate the spots we actually pool at + // using the stride + + strides.shape[1] + - 1) + / strides.shape[1]; + } + crate::language::RelayActivationLayout::NHWC => { + // Sorry for the horrific indentation... + access[1] = + // The dimension plus padding + (((padding.shape[0] + access[1] + padding.shape[2]) + // Get the number of spots where we could pool + - (pool_size.shape[0] - 1)) + // Then calculate the spots we actually pool at + // using the stride + + strides.shape[0] + - 1) + / strides.shape[0]; + access[2] = (((padding.shape[1] + access[2] + padding.shape[3]) + // Get the number of spots where we could pool + - (pool_size.shape[1] - 1)) + // Then calculate the spots we actually pool at + // using the stride + + strides.shape[1] + - 1) + / strides.shape[1]; + } + } + + MyAnalysisData::AccessPattern(access) + } + crate::language::RelayOperator::RelayUpSampling => { + let mut access = match params[1..] + .iter() + .map(|id| &egraph[*id].data) + .collect::>()[..] + { + [MyAnalysisData::AccessPattern(a), MyAnalysisData::Literal(scale_h), MyAnalysisData::Literal(scale_w), MyAnalysisData::RelayActivationLayout(layout)] => + { + assert_eq!( + layout.clone(), + crate::language::RelayActivationLayout::NCHW, + "upsampling only supports NCHW" + ); + // let mut shape = array![a.shape[0], a.shape[1], scale_h.into() * shape[2], scale_w.into() * shape[w]]; + let mut shape = a.shape.clone(); + assert_eq!(scale_h.ndim(), 0); + assert_eq!(scale_w.ndim(), 0); + shape[2] = + (scale_h.first().unwrap() * (shape[2] as f64)).round() as usize; + shape[3] = + (scale_w.first().unwrap() * (shape[3] as f64)).round() as usize; + + AccessPatternData { + shape: shape, + item_shape: a.item_shape.clone(), + zero_regions: a.zero_regions.clone(), + } + } + _ => panic!("Parameters do not type check"), + }; + + if !access.zero_regions.is_empty() { + debug!( + "Throwing away zero region analysis data on line {}", + std::line!() + ); + } + access.zero_regions = HashMap::default(); + MyAnalysisData::AccessPattern(access) } } @@ -5091,6 +5305,146 @@ mod tests { } } + #[test] + fn relay_operator_call_leaky_relu() { + let mut map = HashMap::default(); + map.insert("a".to_string(), vec![32, 64]); + let program = " + (relay-operator-call relay-leaky-relu + (access-tensor a) 0.1) + " + .parse() + .unwrap(); + let mut egraph = + egg::EGraph::::new(MyAnalysis { name_to_shape: map }); + let id = egraph.add_expr(&program); + match &egraph[id].data { + MyAnalysisData::AccessPattern(a) => { + assert_eq!(a.shape, IxDyn(&[32, 64])); + assert_eq!(a.item_shape, IxDyn(&[])); + } + _ => panic!(), + } + } + + #[test] + fn relay_operator_call_avgpool2d() { + let mut map = HashMap::default(); + map.insert("a".to_string(), vec![1, 1280, 7, 7]); + let program = " + (relay-operator-call relay-avg-pool2d + (access-tensor a) + (shape 7 7) + (shape 1 1) + (shape 0 0 0 0) + relay-activation-layout-nchw) + " + .parse() + .unwrap(); + let mut egraph = + egg::EGraph::::new(MyAnalysis { name_to_shape: map }); + let id = egraph.add_expr(&program); + match &egraph[id].data { + MyAnalysisData::AccessPattern(a) => { + assert_eq!(a.shape, IxDyn(&[1, 1280, 1, 1])); + assert_eq!(a.item_shape, IxDyn(&[])); + } + _ => panic!(), + } + } + + #[test] + fn relay_operator_call_upsampling() { + let mut map = HashMap::default(); + map.insert("a".to_string(), vec![1, 1280, 7, 7]); + let program = " + (relay-operator-call relay-upsampling + (access-tensor a) + 2.0 2.0 + (relay-activation-layout-nchw)) + " + .parse() + .unwrap(); + let mut egraph = + egg::EGraph::::new(MyAnalysis { name_to_shape: map }); + let id = egraph.add_expr(&program); + match &egraph[id].data { + MyAnalysisData::AccessPattern(a) => { + assert_eq!(a.shape, IxDyn(&[1, 1280, 14, 14])); + assert_eq!(a.item_shape, IxDyn(&[])); + } + _ => panic!(), + } + } + + #[test] + fn relay_operator_call_sigmoid() { + let mut map = HashMap::default(); + map.insert("a".to_string(), vec![1, 1280, 7, 7]); + let program = " + (relay-operator-call relay-sigmoid + (access-tensor a)) + " + .parse() + .unwrap(); + let mut egraph = + egg::EGraph::::new(MyAnalysis { name_to_shape: map }); + let id = egraph.add_expr(&program); + match &egraph[id].data { + MyAnalysisData::AccessPattern(a) => { + assert_eq!(a.shape, IxDyn(&[1, 1280, 7, 7])); + assert_eq!(a.item_shape, IxDyn(&[])); + } + _ => panic!(), + } + } + + #[test] + fn relay_operator_call_maximum() { + let mut map = HashMap::default(); + map.insert("a".to_string(), vec![1, 1280, 7, 7]); + map.insert("b".to_string(), vec![1, 1280, 1, 1]); + let program = " + (relay-operator-call relay-maximum + (access-tensor a) (access-tensor b)) + " + .parse() + .unwrap(); + let mut egraph = + egg::EGraph::::new(MyAnalysis { name_to_shape: map }); + let id = egraph.add_expr(&program); + match &egraph[id].data { + MyAnalysisData::AccessPattern(a) => { + assert_eq!(a.shape, IxDyn(&[1, 1280, 7, 7])); + assert_eq!(a.item_shape, IxDyn(&[])); + } + _ => panic!(), + } + } + + #[test] + fn relay_operator_call_minimum() { + let mut map = HashMap::default(); + map.insert("a".to_string(), vec![1, 1280, 7, 7]); + map.insert("b".to_string(), vec![1, 1280, 1, 1]); + let program = " + (relay-operator-call relay-minimum + (access-tensor a) (access-tensor b)) + " + .parse() + .unwrap(); + let mut egraph = + egg::EGraph::::new(MyAnalysis { name_to_shape: map }); + let id = egraph.add_expr(&program); + match &egraph[id].data { + MyAnalysisData::AccessPattern(a) => { + assert_eq!(a.shape, IxDyn(&[1, 1280, 7, 7])); + assert_eq!(a.item_shape, IxDyn(&[])); + } + _ => panic!(), + } + } + #[test] fn systolic_array_conv2d_nchw_oihw_with_blocking() { let mut map = HashMap::default(); @@ -5206,4 +5560,53 @@ mod tests { _ => panic!(), } } + + #[test] + fn construct_tuple() { + let mut map = HashMap::default(); + map.insert("a".to_string(), vec![32, 64]); + map.insert("b".to_string(), vec![16, 32]); + let program = " + (construct-tuple (access-tensor a) (access-tensor b)) + " + .parse() + .unwrap(); + let mut egraph = + egg::EGraph::::new(MyAnalysis { name_to_shape: map }); + let id = egraph.add_expr(&program); + match &egraph[id].data { + MyAnalysisData::Tuple(a) => { + assert_eq!(a.len(), 2); + match (a[0].clone(), a[1].clone()) { + (MyAnalysisData::AccessPattern(t1), MyAnalysisData::AccessPattern(t2)) => { + assert_eq!(t1.shape, IxDyn(&[32, 64])); + assert_eq!(t2.shape, IxDyn(&[16, 32])); + } + _ => panic!(), + } + } + _ => panic!(), + } + } + + #[test] + fn tuple_get_item() { + let mut map = HashMap::default(); + map.insert("a".to_string(), vec![32, 64]); + map.insert("b".to_string(), vec![16, 32]); + let program = " + (tuple-get-item (construct-tuple (access-tensor a) (access-tensor b)) 1) + " + .parse() + .unwrap(); + let mut egraph = + egg::EGraph::::new(MyAnalysis { name_to_shape: map }); + let id = egraph.add_expr(&program); + match &egraph[id].data { + MyAnalysisData::AccessPattern(b) => { + assert_eq!(b.shape, IxDyn(&[16, 32])); + } + _ => panic!(), + } + } } diff --git a/src/language/rewrites.rs b/src/language/rewrites.rs index c421eacdb8..7204113095 100644 --- a/src/language/rewrites.rs +++ b/src/language/rewrites.rs @@ -741,7 +741,7 @@ pub fn bubble_reshape_through_cartesian_product() -> RW { struct ApplierImpl { left_shape: Var, right_shape: Var, - }; + } impl Applier for ApplierImpl { fn apply_one(&self, egraph: &mut EG, eclass: Id, subst: &Subst) -> Vec { let left_shape = match &egraph[subst[self.left_shape]].data {