Skip to content
Snippets Groups Projects
Commit e22ac6b3 authored by Sergei Grechanik's avatar Sergei Grechanik Committed by Tianqi Chen
Browse files

[TVM] Fix operator!= for Tensor (#1753)

parent d1e048b7
No related branches found
No related tags found
No related merge requests found
......@@ -45,6 +45,12 @@ class Tensor : public NodeRef {
* \return whether the two tensors equals each other.
*/
inline bool operator==(const Tensor& other) const;
/*!
* \brief check if two tensors are different.
* \param other tensor to be checked.
* \return whether the two tensors are different.
*/
inline bool operator!=(const Tensor& other) const;
/*! \return The dimension of the tensor */
inline size_t ndim() const;
/*!
......@@ -184,6 +190,10 @@ inline bool Tensor::operator==(const Tensor& other) const {
}
}
inline bool Tensor::operator!=(const Tensor& other) const {
return !(*this == other);
}
// macro to turn every operation of slice to expression
#define DEFINE_OVERLOAD_SLICE_UNARY_OP(Op) \
inline Expr operator Op (const Tensor::Slice& a) { \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment