Commit 52e55baa by Josh Pollock Committed by Tianqi Chen

[Relay] Parser Tests (#2209)

parent d3bc59d2
...@@ -26,7 +26,7 @@ class AlphaEqualHandler: ...@@ -26,7 +26,7 @@ class AlphaEqualHandler:
* Check equality of two nodes. * Check equality of two nodes.
* \param lhs The left hand operand. * \param lhs The left hand operand.
* \param rhs The right hand operand. * \param rhs The right hand operand.
* \return the compare result. * \return The compare result.
*/ */
bool Equal(const NodeRef& lhs, const NodeRef& rhs) { bool Equal(const NodeRef& lhs, const NodeRef& rhs) {
if (lhs.same_as(rhs)) return true; if (lhs.same_as(rhs)) return true;
...@@ -46,7 +46,7 @@ class AlphaEqualHandler: ...@@ -46,7 +46,7 @@ class AlphaEqualHandler:
* Check equality of two attributes. * Check equality of two attributes.
* \param lhs The left hand operand. * \param lhs The left hand operand.
* \param rhs The right hand operand. * \param rhs The right hand operand.
* \return the compare result. * \return The compare result.
*/ */
bool AttrEqual(const NodeRef& lhs, const NodeRef& rhs) { bool AttrEqual(const NodeRef& lhs, const NodeRef& rhs) {
return AttrsEqualHandler::Equal(lhs, rhs); return AttrsEqualHandler::Equal(lhs, rhs);
...@@ -55,7 +55,7 @@ class AlphaEqualHandler: ...@@ -55,7 +55,7 @@ class AlphaEqualHandler:
* Check equality of two types. * Check equality of two types.
* \param lhs The left hand operand. * \param lhs The left hand operand.
* \param rhs The right hand operand. * \param rhs The right hand operand.
* \return the compare result. * \return The compare result.
*/ */
bool TypeEqual(const Type& lhs, const Type& rhs) { bool TypeEqual(const Type& lhs, const Type& rhs) {
if (lhs.same_as(rhs)) return true; if (lhs.same_as(rhs)) return true;
...@@ -72,7 +72,7 @@ class AlphaEqualHandler: ...@@ -72,7 +72,7 @@ class AlphaEqualHandler:
* *
* \param lhs The left hand operand. * \param lhs The left hand operand.
* \param rhs The right hand operand. * \param rhs The right hand operand.
* \return the compare result. * \return The compare result.
*/ */
bool ExprEqual(const Expr& lhs, const Expr& rhs) { bool ExprEqual(const Expr& lhs, const Expr& rhs) {
if (lhs.same_as(rhs)) return true; if (lhs.same_as(rhs)) return true;
...@@ -94,7 +94,7 @@ class AlphaEqualHandler: ...@@ -94,7 +94,7 @@ class AlphaEqualHandler:
* \brief Check if data type equals each other. * \brief Check if data type equals each other.
* \param lhs The left hand operand. * \param lhs The left hand operand.
* \param rhs The right hand operand. * \param rhs The right hand operand.
* \return the compare result. * \return The compare result.
*/ */
bool DataTypeEqual(const DataType& lhs, const DataType& rhs) { bool DataTypeEqual(const DataType& lhs, const DataType& rhs) {
return lhs == rhs; return lhs == rhs;
...@@ -104,7 +104,7 @@ class AlphaEqualHandler: ...@@ -104,7 +104,7 @@ class AlphaEqualHandler:
* if map_free_var_ is set to true, try to map via equal node. * if map_free_var_ is set to true, try to map via equal node.
* \param lhs The left hand operand. * \param lhs The left hand operand.
* \param rhs The right hand operand. * \param rhs The right hand operand.
* \return the compare result. * \return The compare result.
*/ */
bool LeafNodeEqual(const NodeRef& lhs, const NodeRef& rhs) { bool LeafNodeEqual(const NodeRef& lhs, const NodeRef& rhs) {
if (lhs.same_as(rhs)) return true; if (lhs.same_as(rhs)) return true;
......
...@@ -38,7 +38,7 @@ inline std::ostream& operator<<(std::ostream& os, const TextValue& val) { // NO ...@@ -38,7 +38,7 @@ inline std::ostream& operator<<(std::ostream& os, const TextValue& val) { // NO
* It can be hard to design a text format for all the possible nodes * It can be hard to design a text format for all the possible nodes
* as the set of nodes can grow when we do more extensions. * as the set of nodes can grow when we do more extensions.
* *
* Instead of trying to design readable text format for every nodes, * Instead of trying to design readable text format for every node,
* we support a meta-data section in the text format. * we support a meta-data section in the text format.
* We allow the text format to refer to a node in the meta-data section. * We allow the text format to refer to a node in the meta-data section.
* *
...@@ -73,7 +73,7 @@ inline std::ostream& operator<<(std::ostream& os, const TextValue& val) { // NO ...@@ -73,7 +73,7 @@ inline std::ostream& operator<<(std::ostream& os, const TextValue& val) { // NO
* \endcode * \endcode
* *
* Note that we store tvm.var("n") in the meta data section. * Note that we store tvm.var("n") in the meta data section.
* Since it is stored in the index-0 in the meta-data seciton, * Since it is stored in the index-0 in the meta-data section,
* we print it as meta.Variable(0). * we print it as meta.Variable(0).
* *
* The text parser can recover this object by loading from the corresponding * The text parser can recover this object by loading from the corresponding
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment