#include "AddCanonicalizer.h"
-#include "Dialect/TFDialect.h"
-#include "Dialect/TFNodes.h"
+#include <moco/IR/TFDialect.h>
+#include <moco/IR/TFNodes.h>
#include "TFEltwiseBinaryCanonicalzeHelper.h"
#include "Transform.h"
#include "SimpleNodeTransform.h"
-#include "Dialect/TFNodes.h"
+
+#include <moco/IR/TFNodes.h>
#include <loco.h>
#include "AvgPoolCanonicalizer.h"
#include "TFShapeInferenceHelper.h"
-#include "Dialect/TFDialect.h"
-#include "Dialect/TFNodes.h"
-#include "Dialect/TFNodeVisitor.h"
-#include "Dialect/TFNodeImpl.h"
+#include <moco/IR/TFDialect.h>
#include "CodecHelper.h"
namespace
{
-bool canonicalize_avgpool2d(loco::Graph *graph, moco::tf::TFAvgPool *node)
+bool canonicalize_avgpool2d(loco::Graph *graph, moco::TFAvgPool *node)
{
LOGGER(l);
#include "Transform.h"
#include "SimpleNodeTransform.h"
-#include "Dialect/TFNodes.h"
+
+#include <moco/IR/TFNodes.h>
#include <loco.h>
/**
* @brief Convert TFAvgPool to Canonical AvgPool2D
*/
-class AvgPoolCanonicalizer : public SimpleNodeTransform<TFAvgPool>
+class AvgPoolCanonicalizer : public SimpleNodeTransform<moco::TFAvgPool>
{
public:
const char *name(void) const final { return "AvgPoolCanonicalizer"; }
#include "BiasAddCanonicalizer.h"
-#include "Dialect/TFDialect.h"
-#include "Dialect/TFNodes.h"
-#include "Dialect/TFNodeVisitor.h"
-#include "Dialect/TFNodeImpl.h"
+#include <moco/IR/TFDialect.h>
#include <moco/tf/Names.h>
#include <moco/Log.h>
{
using plier::tf::DataLayout;
-bool canonicalize_biasadd(loco::Graph *graph, moco::tf::TFBiasAdd *node)
+bool canonicalize_biasadd(loco::Graph *graph, moco::TFBiasAdd *node)
{
LOGGER(l);
#include "Transform.h"
#include "SimpleNodeTransform.h"
-#include "Dialect/TFNodes.h"
+
+#include <moco/IR/TFNodes.h>
#include <loco.h>
/**
* @brief Convert TFBiasAdd to Canonical BiasAdd
*/
-class BiasAddCanonicalizer final : public SimpleNodeTransform<TFBiasAdd>
+class BiasAddCanonicalizer final : public SimpleNodeTransform<moco::TFBiasAdd>
{
public:
const char *name(void) const final { return "BiasAddCanonicalizer"; }
#include "TFShapeInferenceHelper.h"
#include "LogHelper.h"
-#include "Dialect/TFDialect.h"
-#include "Dialect/TFNodes.h"
-#include "Dialect/TFNodeVisitor.h"
-#include "Dialect/TFNodeImpl.h"
+#include <moco/IR/TFDialect.h>
#include <moco/Log.h>
using namespace moco::tf;
-int32_t scala_value(moco::tf::TFConst *node)
+int32_t scala_value(moco::TFConst *node)
{
auto nodeshape = node_shape(node);
assert(node->dtype() == loco::DataType::S32);
return node->at<loco::DataType::S32>(0);
}
-bool canonicalize_concat(loco::Graph *graph, moco::tf::TFConcatV2 *node)
+bool canonicalize_concat(loco::Graph *graph, moco::TFConcatV2 *node)
{
LOGGER(l);
{
// axis should be TFConst
auto axis_node = node->axis();
- auto tfconst = dynamic_cast<moco::tf::TFConst *>(axis_node);
+ auto tfconst = dynamic_cast<moco::TFConst *>(axis_node);
assert(tfconst != nullptr);
axis_value = scala_value(tfconst);
}
#include "Transform.h"
#include "SimpleNodeTransform.h"
-#include "Dialect/TFNodes.h"
+
+#include <moco/IR/TFNodes.h>
#include <loco.h>
/**
* @brief Convert TFConcatV2 to Canonical TensorConcat
*/
-class ConcatV2Canonicalizer : public SimpleNodeTransform<TFConcatV2>
+class ConcatV2Canonicalizer : public SimpleNodeTransform<moco::TFConcatV2>
{
public:
const char *name(void) const final { return "ConcatV2Canonicalizer"; }
public:
- bool transform(TFConcatV2 *node) const final;
+ bool transform(moco::TFConcatV2 *node) const final;
};
} // namespace tf
#include "ConstCanonicalizer.h"
-#include "Dialect/TFDialect.h"
-#include "Dialect/TFNodes.h"
-#include "Dialect/TFNodeVisitor.h"
-#include "Dialect/TFNodeImpl.h"
+#include <moco/IR/TFDialect.h>
#include <moco/tf/Names.h>
#include <moco/Log.h>
namespace
{
-bool canonicalize_const(loco::Graph *graph, moco::tf::TFConst *node)
+bool canonicalize_const(loco::Graph *graph, moco::TFConst *node)
{
LOGGER(l);
#include "Transform.h"
#include "SimpleNodeTransform.h"
-#include "Dialect/TFNodes.h"
+
+#include <moco/IR/TFNodes.h>
#include <loco.h>
/**
* @brief Convert TFConst to Canonical ConstGen
*/
-class ConstCanonicalizer : public SimpleNodeTransform<TFConst>
+class ConstCanonicalizer : public SimpleNodeTransform<moco::TFConst>
{
public:
const char *name(void) const final { return "ConstCanonicalizer"; }
public:
- bool transform(TFConst *) const final;
+ bool transform(moco::TFConst *) const final;
};
} // namespace tf
#include "Conv2DBackpropInputCanonicalizer.h"
-#include "Dialect/TFDialect.h"
-#include "Dialect/TFNodes.h"
+#include <moco/IR/TFDialect.h>
#include "CodecHelper.h"
PlaneShape &output() { return _output; }
loco::Stride<2> &stride() { return _stride; }
loco::Window<2> &window() { return _window; }
- moco::tf::TFPadding &padding() { return _padding; }
+ moco::TFPadding &padding() { return _padding; }
private:
/// @brief Check whether ingredients set by non-default values
PlaneShape _output;
loco::Stride<2> _stride;
loco::Window<2> _window;
- moco::tf::TFPadding _padding;
+ moco::TFPadding _padding;
};
loco::Padding2D Padding2DInference::operator()(void)
{
bool canonicalize_conv2d_backprop_input(loco::Graph *graph,
- moco::tf::TFConv2DBackpropInput *conv2d_backprop)
+ moco::TFConv2DBackpropInput *conv2d_backprop)
{
/**
* @note This will replace TFConv2DBackpropInput node with canonical
#include "Transform.h"
#include "SimpleNodeTransform.h"
-#include "Dialect/TFNodes.h"
+
+#include <moco/IR/TFNodes.h>
#include <loco.h>
{
/// @brief Convert TFConv2DBackpropInput to Canonical TransposedConv2D
-class Conv2DBackpropInputCanonicalizer : public SimpleNodeTransform<TFConv2DBackpropInput>
+class Conv2DBackpropInputCanonicalizer : public SimpleNodeTransform<moco::TFConv2DBackpropInput>
{
public:
const char *name(void) const final { return "Conv2DBackpropInputCanonicalizer"; }
public:
- bool transform(TFConv2DBackpropInput *) const final;
+ bool transform(moco::TFConv2DBackpropInput *) const final;
};
} // namespace tf
#include "Conv2DCanonicalizer.h"
#include "TFShapeInferenceHelper.h"
-#include "Dialect/TFDialect.h"
-#include "Dialect/TFNodes.h"
-#include "Dialect/TFNodeVisitor.h"
-#include "Dialect/TFNodeImpl.h"
+#include <moco/IR/TFDialect.h>
#include "CodecHelper.h"
filter_enc->encoder(std::move(enc));
}
-bool canonicalize_conv2d(loco::Graph *graph, moco::tf::TFConv2D *node)
+bool canonicalize_conv2d(loco::Graph *graph, moco::TFConv2D *node)
{
LOGGER(l);
#include "Transform.h"
#include "SimpleNodeTransform.h"
-#include "Dialect/TFNodes.h"
+
+#include <moco/IR/TFNodes.h>
#include <loco.h>
#include "DepthwiseConv2dNativeCanonicalizer.h"
#include "TFShapeInferenceHelper.h"
-#include "Dialect/TFDialect.h"
-#include "Dialect/TFNodes.h"
-#include "Dialect/TFNodeVisitor.h"
-#include "Dialect/TFNodeImpl.h"
+#include <moco/IR/TFDialect.h>
#include "CodecHelper.h"
filter_enc->encoder(std::move(enc));
}
-bool canonicalize_depthwiseconv2dnative(loco::Graph *graph, moco::tf::TFDepthwiseConv2dNative *node)
+bool canonicalize_depthwiseconv2dnative(loco::Graph *graph, moco::TFDepthwiseConv2dNative *node)
{
LOGGER(l);
#include "Transform.h"
#include "SimpleNodeTransform.h"
-#include "Dialect/TFNodes.h"
+
+#include <moco/IR/TFNodes.h>
namespace moco
{
/**
* @brief Convert TFDepthwiseConv2dNative to Canonical DepthwiseConv2D
*/
-class DepthwiseConv2dNativeCanonicalizer : public SimpleNodeTransform<TFDepthwiseConv2dNative>
+class DepthwiseConv2dNativeCanonicalizer : public SimpleNodeTransform<moco::TFDepthwiseConv2dNative>
{
public:
const char *name(void) const final { return "DepthwiseConv2dNativeCanonicalizer"; }
public:
- bool transform(TFDepthwiseConv2dNative *) const final;
+ bool transform(moco::TFDepthwiseConv2dNative *) const final;
};
} // namespace tf
#include "Convert.h"
-#include "Dialect/TFDialect.h"
-#include "Dialect/TFNodes.h"
-#include "Dialect/TFNodeVisitor.h"
-#include "Dialect/TFNodeImpl.h"
+#include <moco/IR/TFDialect.h>
#include <moco/tf/Names.h>
#include <moco/Log.h>
namespace
{
-bool canonicalize_identity(loco::Graph *graph, moco::tf::TFIdentity *node)
+bool canonicalize_identity(loco::Graph *graph, moco::TFIdentity *node)
{
LOGGER(l);
#include "Transform.h"
#include "SimpleNodeTransform.h"
-#include "Dialect/TFNodes.h"
+
+#include <moco/IR/TFNodes.h>
#include <loco.h>
/**
* @brief Convert TFIdentity to Canonical Forward
*/
-class IdentityCanonicalizer : public SimpleNodeTransform<TFIdentity>
+class IdentityCanonicalizer : public SimpleNodeTransform<moco::TFIdentity>
{
public:
const char *name(void) const final { return "IdentityCanonicalizer"; }
public:
- bool transform(TFIdentity *) const final;
+ bool transform(moco::TFIdentity *) const final;
};
} // namespace tf
#include "MaxPoolCanonicalizer.h"
#include "TFShapeInferenceHelper.h"
-#include "Dialect/TFDialect.h"
-#include "Dialect/TFNodes.h"
-#include "Dialect/TFNodeVisitor.h"
-#include "Dialect/TFNodeImpl.h"
+#include <moco/IR/TFDialect.h>
#include "CodecHelper.h"
namespace
{
-bool canonicalize_maxpool2d(loco::Graph *graph, moco::tf::TFMaxPool *node)
+bool canonicalize_maxpool2d(loco::Graph *graph, moco::TFMaxPool *node)
{
LOGGER(l);
#include "Transform.h"
#include "SimpleNodeTransform.h"
-#include "Dialect/TFNodes.h"
+
+#include <moco/IR/TFNodes.h>
#include <loco.h>
/**
* @brief Convert TFMaxPool to Canonical MaxPool2D
*/
-class MaxPoolCanonicalizer : public SimpleNodeTransform<TFMaxPool>
+class MaxPoolCanonicalizer : public SimpleNodeTransform<moco::TFMaxPool>
{
public:
const char *name(void) const final { return "MaxPoolCanonicalizer"; }
public:
- bool transform(TFMaxPool *) const final;
+ bool transform(moco::TFMaxPool *) const final;
};
} // namespace tf
namespace tf
{
-bool MeanCanonicalizer::transform(TFMean *node) const { return canonicalize_reduce_node(node); }
+bool MeanCanonicalizer::transform(moco::TFMean *node) const
+{
+ return canonicalize_reduce_node(node);
+}
} // namespace tf
} // namespace moco
#include "Transform.h"
#include "SimpleNodeTransform.h"
-#include "Dialect/TFNodes.h"
+
+#include <moco/IR/TFNodes.h>
#include <loco.h>
/**
* @brief Canonicalize TF-dialect TFMean into canonical TensorReduce(Mean) node
*/
-class MeanCanonicalizer : public SimpleNodeTransform<TFMean>
+class MeanCanonicalizer : public SimpleNodeTransform<moco::TFMean>
{
public:
const char *name(void) const final { return "MeanCanonicalizer"; }
public:
- bool transform(TFMean *) const final;
+ bool transform(moco::TFMean *) const final;
};
} // namespace tf
#include "MulCanonicalizer.h"
-#include "Dialect/TFDialect.h"
-#include "Dialect/TFNodes.h"
+#include <moco/IR/TFDialect.h>
#include "TFEltwiseBinaryCanonicalzeHelper.h"
namespace tf
{
-bool MulCanonicalizer::transform(TFMul *node) const
+bool MulCanonicalizer::transform(moco::TFMul *node) const
{
return canonicalize_eltwise_binary_node(node);
}
#include "Transform.h"
#include "SimpleNodeTransform.h"
-#include "Dialect/TFNodes.h"
+
+#include <moco/IR/TFNodes.h>
#include <loco.h>
/**
* @brief Convert TFMul to Canonical EltwiseMul
*/
-class MulCanonicalizer : public SimpleNodeTransform<TFMul>
+class MulCanonicalizer : public SimpleNodeTransform<moco::TFMul>
{
public:
const char *name(void) const final { return "MulCanonicalizer"; }
public:
- bool transform(TFMul *) const final;
+ bool transform(moco::TFMul *) const final;
};
} // namespace tf
#include "PadCanonicalizer.h"
-#include "Dialect/TFDialect.h"
-#include "Dialect/TFNodes.h"
-#include "Dialect/TFNodeVisitor.h"
-#include "Dialect/TFNodeImpl.h"
+#include <moco/IR/TFDialect.h>
#include "loco/Service/TypeInference.h"
namespace
{
-bool canonicalize_pad(loco::Graph *graph, moco::tf::TFPad *node)
+bool canonicalize_pad(loco::Graph *graph, moco::TFPad *node)
{
/**
* @note This will replace TFPad node with Canonical TensorConstantPad
#include "Transform.h"
#include "SimpleNodeTransform.h"
-#include "Dialect/TFNodes.h"
+
+#include <moco/IR/TFNodes.h>
namespace moco
{
/**
* @brief Convert TFPad to Canonical TensorConstantPad
*/
-class PadCanonicalizer final : public SimpleNodeTransform<TFPad>
+class PadCanonicalizer final : public SimpleNodeTransform<moco::TFPad>
{
public:
const char *name(void) const final { return "PadCanonicalizer"; }
public:
- bool transform(TFPad *) const final;
+ bool transform(moco::TFPad *) const final;
};
} // namespace tf
#include "PlaceholderCanonicalizer.h"
-#include "Dialect/TFDialect.h"
-#include "Dialect/TFNodes.h"
-#include "Dialect/TFNodeVisitor.h"
-#include "Dialect/TFNodeImpl.h"
+#include <moco/IR/TFDialect.h>
#include <moco/tf/Names.h>
#include <moco/Log.h>
#include "RealDivCanonicalizer.h"
-#include "Dialect/TFDialect.h"
-#include "Dialect/TFNodes.h"
+#include <moco/IR/TFDialect.h>
#include "TFEltwiseBinaryCanonicalzeHelper.h"
namespace tf
{
-bool RealDivCanonicalizer::transform(TFRealDiv *node) const
+bool RealDivCanonicalizer::transform(moco::TFRealDiv *node) const
{
return canonicalize_eltwise_binary_node(node);
}
#include "Transform.h"
#include "SimpleNodeTransform.h"
-#include "Dialect/TFNodes.h"
+
+#include <moco/IR/TFNodes.h>
#include <loco.h>
/**
* @brief Convert TFRealDiv to Canonical EltwiseDiv
*/
-class RealDivCanonicalizer : public SimpleNodeTransform<TFRealDiv>
+class RealDivCanonicalizer : public SimpleNodeTransform<moco::TFRealDiv>
{
public:
const char *name(void) const final { return "RealDivCanonicalizer"; }
public:
- bool transform(TFRealDiv *) const final;
+ bool transform(moco::TFRealDiv *) const final;
};
} // namespace tf
#include "Relu6Canonicalizer.h"
-#include "Dialect/TFDialect.h"
-#include "Dialect/TFNodes.h"
-#include "Dialect/TFNodeVisitor.h"
-#include "Dialect/TFNodeImpl.h"
+#include <moco/IR/TFDialect.h>
#include <stdex/Memory.h>
namespace
{
-bool canonicalize_relu6(loco::Graph *graph, moco::tf::TFRelu6 *node)
+bool canonicalize_relu6(loco::Graph *graph, moco::TFRelu6 *node)
{
/**
* @note This will replace TFRelu6 node with Canonical ReLU6
#include "Transform.h"
#include "SimpleNodeTransform.h"
-#include "Dialect/TFNodes.h"
+
+#include <moco/IR/TFNodes.h>
#include <loco.h>
/**
* @brief Convert TFRelu6 to Canonical ReLU6
*/
-class Relu6Canonicalizer : public SimpleNodeTransform<TFRelu6>
+class Relu6Canonicalizer : public SimpleNodeTransform<moco::TFRelu6>
{
public:
const char *name(void) const final { return "Relu6Canonicalizer"; }
public:
- bool transform(TFRelu6 *) const final;
+ bool transform(moco::TFRelu6 *) const final;
};
} // namespace tf
#include "ReluCanonicalizer.h"
-#include "Dialect/TFDialect.h"
-#include "Dialect/TFNodes.h"
-#include "Dialect/TFNodeVisitor.h"
-#include "Dialect/TFNodeImpl.h"
+#include <moco/IR/TFDialect.h>
#include <stdex/Memory.h>
namespace
{
-bool canonicalize_relu(loco::Graph *graph, moco::tf::TFRelu *node)
+bool canonicalize_relu(loco::Graph *graph, moco::TFRelu *node)
{
/**
* @note This will replace TFRelu node with Canonical ReLU
#include "Transform.h"
#include "SimpleNodeTransform.h"
-#include "Dialect/TFNodes.h"
+
+#include <moco/IR/TFNodes.h>
#include <loco.h>
/**
* @brief Convert TFRelu to Canonical ReLU
*/
-class ReluCanonicalizer : public SimpleNodeTransform<TFRelu>
+class ReluCanonicalizer : public SimpleNodeTransform<moco::TFRelu>
{
public:
const char *name(void) const final { return "ReluCanonicalizer"; }
public:
- bool transform(TFRelu *) const final;
+ bool transform(moco::TFRelu *) const final;
};
} // namespace tf
#include "ReshapeCanonicalizer.h"
-#include "Dialect/TFDialect.h"
-#include "Dialect/TFNodeImpl.h"
+#include <moco/IR/TFDialect.h>
#include <moco/Log.h>
#include <plier/tf/Convert.h>
/**
* @brief Check whether given 'new shape' arg is a fixed shape input for Reshape
*
- * ConstNode can be moco::tf::TFConst or loco::ConstGen
+ * ConstNode can be moco::TFConst or loco::ConstGen
*/
template <typename ConstNode> bool is_fixed_shape_input(ConstNode *const_shape_input)
{
}
/// @note Currently only supports to canonicalize Fixed Reshape
-bool canonicalize_reshape(loco::Graph *graph, moco::tf::TFReshape *node)
+bool canonicalize_reshape(loco::Graph *graph, moco::TFReshape *node)
{
LOGGER(l);
INFO(l) << "TFNodeCanonicalize TFReshape begin";
// Supports 2 cases for Reshape's shape input:
// TF-dialect TFConst or Canonical ConstGen
loco::Node *shape_input = node->shape();
- auto tfconst_shape_input = dynamic_cast<moco::tf::TFConst *>(shape_input);
+ auto tfconst_shape_input = dynamic_cast<moco::TFConst *>(shape_input);
auto constgen_shape_input = dynamic_cast<loco::ConstGen *>(shape_input);
if (tfconst_shape_input)
#include "Transform.h"
#include "SimpleNodeTransform.h"
-#include "Dialect/TFNodes.h"
+
+#include <moco/IR/TFNodes.h>
#include <loco.h>
/**
* @brief Convert TFReshape to Canonical Reshape
*/
-class ReshapeCanonicalizer : public SimpleNodeTransform<TFReshape>
+class ReshapeCanonicalizer : public SimpleNodeTransform<moco::TFReshape>
{
public:
const char *name(void) const final { return "ReshapeCanonicalizer"; }
public:
- bool transform(TFReshape *) const final;
+ bool transform(moco::TFReshape *) const final;
};
} // namespace tf
#include "RsqrtCanonicalizer.h"
#include "TFShapeInferenceHelper.h"
-#include "Dialect/TFDialect.h"
-#include "Dialect/TFNodes.h"
-#include "Dialect/TFNodeVisitor.h"
-#include "Dialect/TFNodeImpl.h"
+#include <moco/IR/TFDialect.h>
#include <moco/Log.h>
}
}
-bool canonicalize_rsqrt(loco::Graph *graph, moco::tf::TFRsqrt *node)
+bool canonicalize_rsqrt(loco::Graph *graph, moco::TFRsqrt *node)
{
/**
* @note This will replace TFRsqrt node with Canonical EltwiseSqrt + EltwiseRealDiv
#include "Transform.h"
#include "SimpleNodeTransform.h"
-#include "Dialect/TFNodes.h"
+
+#include <moco/IR/TFNodes.h>
#include <loco.h>
/**
* @brief Convert TFRsqrt to Canonical EltwiseDiv + EltwiseSqrt
*/
-class RsqrtCanonicalizer : public SimpleNodeTransform<TFRsqrt>
+class RsqrtCanonicalizer : public SimpleNodeTransform<moco::TFRsqrt>
{
public:
const char *name(void) const final { return "RsqrtCanonicalizer"; }
public:
- bool transform(TFRsqrt *) const final;
+ bool transform(moco::TFRsqrt *) const final;
};
} // namespace tf
#include "SoftmaxCanonicalizer.h"
#include "TFShapeInferenceHelper.h"
-#include "Dialect/TFDialect.h"
-#include "Dialect/TFNodes.h"
-#include "Dialect/TFNodeVisitor.h"
-#include "Dialect/TFNodeImpl.h"
+#include <moco/IR/TFDialect.h>
#include <moco/Log.h>
namespace
{
-bool canonicalize_softmax(loco::Graph *graph, moco::tf::TFSoftmax *node)
+bool canonicalize_softmax(loco::Graph *graph, moco::TFSoftmax *node)
{
LOGGER(l);
#include "Transform.h"
#include "SimpleNodeTransform.h"
-#include "Dialect/TFNodes.h"
+
+#include <moco/IR/TFNodes.h>
#include <loco.h>
/**
* @brief Canonicalize TF-dialect TFSoftmax into canonical Softmax node
*/
-class SoftmaxCanonicalizer : public SimpleNodeTransform<TFSoftmax>
+class SoftmaxCanonicalizer : public SimpleNodeTransform<moco::TFSoftmax>
{
public:
const char *name(void) const final { return "SoftmaxCanonicalizer"; }
public:
- bool transform(TFSoftmax *) const final;
+ bool transform(moco::TFSoftmax *) const final;
};
} // namespace tf
#include "SqrtCanonicalizer.h"
-#include "Dialect/TFDialect.h"
-#include "Dialect/TFNodes.h"
-#include "Dialect/TFNodeVisitor.h"
-#include "Dialect/TFNodeImpl.h"
+#include <moco/IR/TFDialect.h>
namespace
{
-bool canonicalize_sqrt(loco::Graph *graph, moco::tf::TFSqrt *node)
+bool canonicalize_sqrt(loco::Graph *graph, moco::TFSqrt *node)
{
/**
* @note This will replace TFSqrt node with Canonical EltwiseSqrt
#include "Transform.h"
#include "SimpleNodeTransform.h"
-#include "Dialect/TFNodes.h"
+
+#include <moco/IR/TFNodes.h>
#include <loco.h>
/**
* @brief Convert TFsqrt to Canonical EltwiseSqrt
*/
-class SqrtCanonicalizer : public SimpleNodeTransform<TFSqrt>
+class SqrtCanonicalizer : public SimpleNodeTransform<moco::TFSqrt>
{
public:
const char *name(void) const final { return "SqrtCanonicalizer"; }
public:
- bool transform(TFSqrt *) const final;
+ bool transform(moco::TFSqrt *) const final;
};
} // namespace tf
#include "SqueezeCanonicalizer.h"
#include "TFShapeInferenceHelper.h"
-#include "Dialect/TFDialect.h"
-#include "Dialect/TFNodes.h"
-#include "Dialect/TFNodeVisitor.h"
-#include "Dialect/TFNodeImpl.h"
+#include <moco/IR/TFDialect.h>
#include <moco/Log.h>
namespace
{
-bool canonicalize_squeeze_to_reshape(loco::Graph *graph, moco::tf::TFSqueeze *node)
+bool canonicalize_squeeze_to_reshape(loco::Graph *graph, moco::TFSqueeze *node)
{
LOGGER(l);
#include "Transform.h"
#include "SimpleNodeTransform.h"
-#include "Dialect/TFNodes.h"
+
+#include <moco/IR/TFNodes.h>
#include <loco.h>
*
* @note There is no canonical Squeeze node
*/
-class SqueezeCanonicalizer : public SimpleNodeTransform<TFSqueeze>
+class SqueezeCanonicalizer : public SimpleNodeTransform<moco::TFSqueeze>
{
public:
const char *name(void) const final { return "SqueezeCanonicalizer"; }
public:
- bool transform(TFSqueeze *) const final;
+ bool transform(moco::TFSqueeze *) const final;
};
} // namespace tf
#include "StopGradientCanonicalizer.h"
-#include "Dialect/TFDialect.h"
-#include "Dialect/TFNodes.h"
-#include "Dialect/TFNodeVisitor.h"
-#include "Dialect/TFNodeImpl.h"
+#include <moco/IR/TFDialect.h>
#include <moco/Log.h>
namespace
{
-bool canonicalize_stopgradient(loco::Graph *graph, moco::tf::TFStopGradient *node)
+bool canonicalize_stopgradient(loco::Graph *graph, moco::TFStopGradient *node)
{
LOGGER(l);
#include "Transform.h"
#include "SimpleNodeTransform.h"
-#include "Dialect/TFNodes.h"
+
+#include <moco/IR/TFNodes.h>
#include <loco.h>
/**
* @brief Canonicalize TF-dialect TFStopGradient into canonical Forward node
*/
-class StopGradientCanonicalizer : public SimpleNodeTransform<TFStopGradient>
+class StopGradientCanonicalizer : public SimpleNodeTransform<moco::TFStopGradient>
{
public:
const char *name(void) const final { return "StopGradientCanonicalizer"; }
public:
- bool transform(TFStopGradient *) const final;
+ bool transform(moco::TFStopGradient *) const final;
};
} // namespace tf
#include "SubCanonicalizer.h"
-#include "Dialect/TFDialect.h"
-#include "Dialect/TFNodes.h"
+#include <moco/IR/TFDialect.h>
#include "TFEltwiseBinaryCanonicalzeHelper.h"
namespace tf
{
-bool SubCanonicalizer::transform(TFSub *node) const
+bool SubCanonicalizer::transform(moco::TFSub *node) const
{
return canonicalize_eltwise_binary_node(node);
}
#include "Transform.h"
#include "SimpleNodeTransform.h"
-#include "Dialect/TFNodes.h"
+
+#include <moco/IR/TFNodes.h>
#include <loco.h>
/**
* @brief Convert TFSub to Canonical EltwiseSub
*/
-class SubCanonicalizer : public SimpleNodeTransform<TFSub>
+class SubCanonicalizer : public SimpleNodeTransform<moco::TFSub>
{
public:
const char *name(void) const final { return "SubCanonicalizer"; }
public:
- bool transform(TFSub *) const final;
+ bool transform(moco::TFSub *) const final;
};
} // namespace tf
#include "TanhCanonicalizer.h"
-#include "Dialect/TFDialect.h"
-#include "Dialect/TFNodes.h"
-#include "Dialect/TFNodeVisitor.h"
-#include "Dialect/TFNodeImpl.h"
+#include <moco/IR/TFDialect.h>
#include <stdex/Memory.h>
namespace
{
-bool canonicalize_tanh(loco::Graph *graph, moco::tf::TFTanh *node)
+bool canonicalize_tanh(loco::Graph *graph, moco::TFTanh *node)
{
/**
* @note This will replace TFTanh node with Canonical Tanh
#include "Transform.h"
#include "SimpleNodeTransform.h"
-#include "Dialect/TFNodes.h"
+
+#include <moco/IR/TFNodes.h>
#include <loco.h>
/**
* @brief Convert TFTanh to Canonical Tanh
*/
-class TanhCanonicalizer : public SimpleNodeTransform<TFTanh>
+class TanhCanonicalizer : public SimpleNodeTransform<moco::TFTanh>
{
public:
const char *name(void) const final { return "TanhCanonicalizer"; }
public:
- bool transform(TFTanh *) const override;
+ bool transform(moco::TFTanh *) const override;
};
} // namespace tf
#include "Canonicalization/SubCanonicalizer.h"
#include "Canonicalization/TanhCanonicalizer.h"
-#include "Dialect/TFDialect.h"
-#include "Dialect/TFNodes.h"
+#include <moco/IR/TFDialect.h>
+#include <moco/IR/TFNodes.h>
#include <logo/Phase.h>
auto active_nodes = loco::active_nodes(loco::output_nodes(g));
for (auto node : active_nodes)
{
- if (node->dialect() == moco::tf::TFDialect::get())
+ if (node->dialect() == moco::TFDialect::get())
{
return true;
}
#include "ShapeInferencePass.h"
-#include "Dialect/TFDialect.h"
+#include <moco/IR/TFDialect.h>
#include <moco/Service/TFShapeInferenceRule.h>
#include "TypeInferencePass.h"
-#include "Dialect/TFDialect.h"
+#include <moco/IR/TFDialect.h>
#include <moco/Service/TFTypeInferenceRule.h>