forked from apache/mxnet
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change TOPI ops to use C++ implementation where applicable (apache#357)
* Updated TVM version. Implemented fix for nnvm_compiler crash on exit on windows. Changed TOPI ops from using python to using C++ where applicable. * Fix lint * Fix lint * Fix macro * Fix reshape * Update TVM to fix test fails
- Loading branch information
1 parent
6004907
commit 96b7934
Showing
17 changed files
with
422 additions
and
170 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/*! | ||
* Copyright (c) 2016 by Contributors | ||
* \file util.h | ||
* \brief Utility functions for nnvm compiler | ||
*/ | ||
#ifndef NNVM_COMPILER_UTIL_H_ | ||
#define NNVM_COMPILER_UTIL_H_ | ||
|
||
#include <tvm/expr.h> | ||
#include <nnvm/tuple.h> | ||
|
||
namespace nnvm { | ||
namespace compiler { | ||
|
||
/* | ||
* \brief Helper function to convert TShape to TVM array. Useful for | ||
* passing data from NNVM param structures to TOPI ops. | ||
* | ||
* \param shape The shape to convert | ||
* | ||
* \return An Array of Expr, where each element is a constant int32 | ||
*/ | ||
inline tvm::Array<tvm::Expr> ShapeToArray(TShape shape) { | ||
tvm::Array<tvm::Expr> result; | ||
for (auto i : shape) { | ||
result.push_back(tvm::make_const(tvm::Int(32), i)); | ||
} | ||
return result; | ||
} | ||
|
||
} // namespace compiler | ||
} // namespace nnvm | ||
#endif // NNVM_COMPILER_UTIL_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.