* [REFACTOR][IR] tvm::Expr -> PrimExpr(Primitive Expr)
As part of unified IR, we will need to unify relay::Expr
and the current tvm::Expr under the same base type.
From the techinical point of view. tvm::Expr is a "primitive"
expression that only contains POD types and handles and does
not do life-cycle management.
This PR renames Expr->PrimExpr to clarify that.
We will send a subsequent PR to introduce the base expr class.
* Remove legacy VarExpr and ExprHash/Equal
* Added 1D pooling to Topi
* Added 1D pooling relay op and tests.
* Added onnx parsing and tests for maxpool1d and averagepool1d
* formatting
* moved partial import.
* Fixed typo.
* [AutoTVM] Use vm compile in extracting task from relay
* update
* restructure vm compiler to reduce task extraction time
* x
* fix
* update doc
* udpate doc
* lint
* Make Relay Keras frontend support networks created using
Tensorflow (1.13) Keras implementation (tf.Keras)
* Modify Keras frontend tests to run from a class rather than a
function based script
* Adjust Keras frontend tests to run with both 'Keras' and 'tf.Keras'
* Change "TestKeras.test_forward_merge" to validate instances by
class name rather than instance type
* As a result of backwards incompatible changes released in pillow 7.0,
torchvision crashes if you just "pip install pillow", as we do in
a few places.
* This patch sets pillow<7 to be installed in Dockerfiles and support
material as tutorials and documentation.
* [REFACTOR][IR] Introduce SeqStmt to replace Block
ir::Block was used to represent a sequence of Stmts in the original low-level IR.
The nested ir::Block structure is not really friendly for recursive visits,
especially when the statements are unrolled.
This PR introduce a SeqStmt that directly stores a sequence of statements in an Array container.
The new SeqStmt will be used as a replacement of the original Block structure.
* [REFACTOR] Migrate use of Block to SeqStmt.
* [REFACTOR] Remove Block
* Add more comments per yizhi's comment
Currently, we use a tvm::Var to represent a placeholder for shapes in generic types.
This is not necessary for GlobalTypeVar(as we never parameterize by shape var),
and is a bit twisted for TypeVar.
As we move to a unified type system, we want to break the dependency
from the base TypeVar(which is shared across the languages) from the expression.
Note that it is fine for TensorType to depend on Expr.
One alternative solution to embed the Var would be to introduce a TypeVarExpr,
which can wrap a TypeVar as Expr. However, this new alternative won't be
natural until we migrate the type to the global scope.
Lucikly, we have not yet start to depend on the shape parameterization heavily yet.
This PR removes the tvm::Var from the typevars. We will follow up with another
PR to migrate the types to a base location. After that, we should be able to
use the more elegant approach via TypeVarExpr.
* [REFACTOR][RUNTIME] Move NDArray to Object System.
Previously NDArray has its own object reference counting mechanism.
This PR migrates NDArray to the unified object protocol.
The calling convention of NDArray remained intact.
That means NDArray still has its own type_code and
its handle is still DLTensor compatible.
In order to do so, this PR added a few minimum runtime type
detection in TVMArgValue and RetValue only when the corresponding
type is a base type(ObjectRef) that could also refer to NDArray.
This means that even if we return a base reference object ObjectRef
which refers to the NDArray. The type_code will still be translated
correctly as kNDArrayContainer.
If we assign a non-base type(say Expr) that we know is not compatible
with NDArray during compile time, no runtime type detection will be performed.
This PR also adopts the object protocol for NDArray sub-classing and
removed the legacy NDArray subclass protocol.
Examples in apps/extension are now updated to reflect that.
Making NDArray as an Object brings all the benefits of the object system.
For example, we can now use the Array container to store NDArrays.
* Address review comments
* [FRONTEND][TF] conv3d_transpose 'SAME' support kernel more than 1x1
* revised per as review comments
* add more fallback wolkaround to make all tests pass
* [TOPI] add 3D upsampling Op.
* fix lint issues
* change align_corners to coordinate_transformation_mode
* fix resize3d half_pixel
* make a simple function and clean up trilinear_resize3d_python
* fix doc
* [AutoTVM][TOPI] NHWC conv2d templates (spatial pack) for ARM
As some frontends (tflite for example) are using NHWC as the default
layout, we are enabling NHWC schedule templates in TOPI and AutoTVM.
* some comments fix
Before the unified object protocol, we support pass
additional extension objects around by declaring a type as an extension type.
The old extension mechanism requires the types to register their
constructor and deleter to a VTable and does not enjoy the benefit of the
self-contained deletion property of the new Object system.
This PR upgrades the extension example to make use of the new object system
and removed the old Extension VTable.
Note that the register_extension funtion in the python side continues to work
when the passed argument does not require explicit container copy/deletion,
which covers the current usecases of the extension mechanism.
* Add Expand to onnx.py
* add test function for expand
* Fix a onnx frontend test
* Add tests for the value itself instead of shape only on test_expand
* Cleaned up some unnecessary modifications.
* Fix bias_add gradient
A change caused collapse_sum_like to reject implicit dimension
broadcasting for bias_add gradient, so switch to explicit sum reduction
on the non-bias axis dimensions.
* Lint fix