target_link_libraries(moco_tf_frontend PUBLIC moco_pass)
target_link_libraries(moco_tf_frontend PUBLIC mio_tf)
target_link_libraries(moco_tf_frontend PRIVATE moco_service)
+target_link_libraries(moco_tf_frontend PRIVATE moco_support)
target_link_libraries(moco_tf_frontend PRIVATE bino)
target_link_libraries(moco_tf_frontend PRIVATE fipe)
target_link_libraries(moco_tf_frontend PRIVATE locop)
*/
#include "AvgPoolCanonicalizer.h"
-#include "TFShapeInferenceHelper.h"
#include <moco/IR/TFDialect.h>
+#include <moco/Support/TFShapeInferenceHelper.h>
#include "CodecHelper.h"
avgPool2d_node->convention(loco::AvgPool2D::Convention::Valid);
- auto value_shape = moco::tf::node_shape(node->value());
+ auto value_shape = moco::node_shape(node->value());
assert(value_shape.domain() != loco::Domain::Unknown);
- auto node_stride = moco::tf::stride_of(node->strides(), node->data_layout());
- auto node_window = moco::tf::window_of(node->ksize(), node->data_layout());
+ auto node_stride = moco::stride_of(node->strides(), node->data_layout());
+ auto node_window = moco::window_of(node->ksize(), node->data_layout());
- moco::tf::Padding2DInference infer_padding2d;
+ moco::Padding2DInference infer_padding2d;
infer_padding2d.padding(node->padding());
infer_padding2d.stride(node_stride);
infer_padding2d.window(node_window);
- auto input_feature_shape = moco::tf::as_feature_shape(value_shape, node->data_layout());
- auto input_plane_shape = moco::tf::make_plane_shape(input_feature_shape);
+ auto input_feature_shape = moco::as_feature_shape(value_shape, node->data_layout());
+ auto input_plane_shape = moco::make_plane_shape(input_feature_shape);
*avgPool2d_node->pad() = infer_padding2d(input_plane_shape);
*avgPool2d_node->stride() = node_stride;
*/
#include "Conv2DCanonicalizer.h"
-#include "TFShapeInferenceHelper.h"
#include <moco/IR/TFDialect.h>
+#include <moco/Support/TFShapeInferenceHelper.h>
#include "CodecHelper.h"
set_filter_enc(filter_enc);
set_feature_dec(feature_dec, data_layout);
- auto input_shape = moco::tf::node_shape(node->input());
+ auto input_shape = moco::node_shape(node->input());
assert(input_shape.domain() != loco::Domain::Unknown);
- auto ker_shape = moco::tf::node_shape(node->filter());
+ auto ker_shape = moco::node_shape(node->filter());
auto ker_tensor_shape = ker_shape.as<loco::TensorShape>(); // in HWIO
- auto node_stride = moco::tf::stride_of(node->strides(), node->data_layout());
- auto node_window = moco::tf::window_of(ker_tensor_shape, "HWIO");
+ auto node_stride = moco::stride_of(node->strides(), node->data_layout());
+ auto node_window = moco::window_of(ker_tensor_shape, "HWIO");
- moco::tf::Padding2DInference infer_padding2d;
+ moco::Padding2DInference infer_padding2d;
infer_padding2d.padding(node->padding());
infer_padding2d.stride(node_stride);
infer_padding2d.window(node_window);
- auto input_feature_shape = moco::tf::as_feature_shape(input_shape, node->data_layout());
- auto input_plane_shape = moco::tf::make_plane_shape(input_feature_shape);
+ auto input_feature_shape = moco::as_feature_shape(input_shape, node->data_layout());
+ auto input_plane_shape = moco::make_plane_shape(input_feature_shape);
*conv2d->pad() = infer_padding2d(input_plane_shape);
*conv2d->stride() = node_stride;
*/
#include "DepthwiseConv2dNativeCanonicalizer.h"
-#include "TFShapeInferenceHelper.h"
#include <moco/IR/TFDialect.h>
+#include <moco/Support/TFShapeInferenceHelper.h>
#include "CodecHelper.h"
set_feature_dec(feature_dec, data_layout);
// Calculate Pad and Stride from inference
- auto input_shape = moco::tf::node_shape(node->input());
- auto ker_shape = moco::tf::node_shape(node->filter());
+ auto input_shape = moco::node_shape(node->input());
+ auto ker_shape = moco::node_shape(node->filter());
auto ker_tensor_shape = ker_shape.as<loco::TensorShape>();
- auto node_stride = moco::tf::stride_of(node->strides(), node->data_layout());
- auto node_window = moco::tf::window_of(ker_tensor_shape, "HWCM");
+ auto node_stride = moco::stride_of(node->strides(), node->data_layout());
+ auto node_window = moco::window_of(ker_tensor_shape, "HWCM");
- moco::tf::Padding2DInference infer_padding2d;
+ moco::Padding2DInference infer_padding2d;
infer_padding2d.padding(node->padding());
infer_padding2d.stride(node_stride);
infer_padding2d.window(node_window);
- auto input_feature_shape = moco::tf::as_feature_shape(input_shape, node->data_layout());
- auto input_plane_shape = moco::tf::make_plane_shape(input_feature_shape);
+ auto input_feature_shape = moco::as_feature_shape(input_shape, node->data_layout());
+ auto input_plane_shape = moco::make_plane_shape(input_feature_shape);
*depthwiseconv2d->pad() = infer_padding2d(input_plane_shape);
*depthwiseconv2d->stride() = node_stride;
*/
#include "MaxPoolCanonicalizer.h"
-#include "TFShapeInferenceHelper.h"
#include <moco/IR/TFDialect.h>
+#include <moco/Support/TFShapeInferenceHelper.h>
#include "CodecHelper.h"
set_feature_dec(feature_dec, data_layout);
// paddata to pad
- auto input_shape = moco::tf::node_shape(node->input());
+ auto input_shape = moco::node_shape(node->input());
assert(input_shape.domain() != loco::Domain::Unknown);
- auto node_stride = moco::tf::stride_of(node->strides(), node->data_layout());
- auto node_window = moco::tf::window_of(node->ksize(), node->data_layout());
+ auto node_stride = moco::stride_of(node->strides(), node->data_layout());
+ auto node_window = moco::window_of(node->ksize(), node->data_layout());
- moco::tf::Padding2DInference infer_padding2d;
+ moco::Padding2DInference infer_padding2d;
infer_padding2d.padding(node->padding());
infer_padding2d.stride(node_stride);
infer_padding2d.window(node_window);
- auto input_feature_shape = moco::tf::as_feature_shape(input_shape, node->data_layout());
- auto input_plane_shape = moco::tf::make_plane_shape(input_feature_shape);
+ auto input_feature_shape = moco::as_feature_shape(input_shape, node->data_layout());
+ auto input_plane_shape = moco::make_plane_shape(input_feature_shape);
*maxPool2d_node->pad() = infer_padding2d(input_plane_shape);
*maxPool2d_node->stride() = node_stride;