- Changes most of the relay docs to use autosummary.
- Bring relay API docs to the top-level flat view for easier discovery
- Removed a few cases of re-exports.
tir
te
driver
+ relay/index
+ relay/frontend
+ relay/nn
+ relay/vision
+ relay/image
+ relay/transform
+ relay/analysis
+ relay/backend
+ relay/testing
autotvm
rpc
contrib
graph_runtime
- relay/index
vta/index
topi
------------------
.. automodule:: tvm.relay.frontend
-
-.. autofunction:: tvm.relay.frontend.from_mxnet
-
-.. autofunction:: tvm.relay.frontend.from_keras
-
-.. autofunction:: tvm.relay.frontend.from_onnx
-
-.. autofunction:: tvm.relay.frontend.from_tflite
-
-.. autofunction:: tvm.relay.frontend.from_coreml
-
-.. autofunction:: tvm.relay.frontend.from_caffe2
-
-.. autofunction:: tvm.relay.frontend.from_tensorflow
-
-.. autofunction:: tvm.relay.frontend.from_pytorch
+ :members:
+ :imported-members:
+ :autosummary:
tvm.relay.image
---------------
-.. automodule:: tvm.relay.op.image
+.. automodule:: tvm.relay.image
:members:
:imported-members:
- :exclude-members:
+ :autosummary:
under the License.
tvm.relay
-=========
-
-This document contains the Python API for the Relay frontend, optimizer, and
-compiler toolchain.
-
-Relay is the second-generation, high-level intermediate representation (IR) for the TVM
-compiler stack.
-
-.. toctree::
- :maxdepth: 2
-
- analysis
- backend
- frontend
- image
- transform
- nn
- op
- vision
- testing
+---------
.. automodule:: tvm.relay
:members:
:imported-members:
- :exclude-members: RelayExpr, Pass, PassInfo, function_pass, PassContext,
- ModulePass, FunctionPass, Sequential, module_pass, Type, TypeKind,
+ :exclude-members: RelayExpr,
+ Type, TypeKind,
TypeVar, GlobalTypeVar, TypeConstraint, FuncType, TupleType, IncompleteType,
TypeCall, TypeRelation, TensorType, RelayRefType, GlobalVar, SourceName,
Span, Var, Op, Constructor
tvm.relay.nn
------------
-.. automodule:: tvm.relay.op.nn.nn
+.. automodule:: tvm.relay.nn
:members:
:imported-members:
- :exclude-members:
+ :autosummary:
+++ /dev/null
-.. Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
-.. http://www.apache.org/licenses/LICENSE-2.0
-
-.. Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-
-tvm.relay.op
-------------
-.. automodule:: tvm.relay.op
- :members:
- :imported-members:
- :exclude-members: Tuple, TupleWrapper
- :autosummary:
tvm.relay.testing
-----------------
-.. autoclass:: tvm.relay.testing.resnet
+.. automodule:: tvm.relay.testing
+ :members:
+ :imported-members:
+ :autosummary:
+
+.. automodule:: tvm.relay.testing.mlp
+ :members:
+
+.. automodule:: tvm.relay.testing.resnet
+ :members:
+
+.. automodule:: tvm.relay.testing.dcgan
+ :members:
+
+.. automodule:: tvm.relay.testing.mobilenet
+ :members:
+
+.. automodule:: tvm.relay.testing.lstm
+ :members:
+
+.. automodule:: tvm.relay.testing.inception_v3
+ :members:
+
+.. automodule:: tvm.relay.testing.squeezenet
+ :members:
+
+.. automodule:: tvm.relay.testing.vgg
+ :members:
+
+.. automodule:: tvm.relay.testing.densenet
+ :members:
.. automodule:: tvm.relay.transform
:members:
:imported-members:
- :exclude-members: Object
:autosummary:
tvm.relay.vision
----------------
-.. automodule:: tvm.relay.op.vision
+.. automodule:: tvm.relay.vision
:members:
:imported-members:
:autosummary:
# under the License.
# pylint: disable=wildcard-import
"""Image network related operators."""
-from __future__ import absolute_import as _abs
from .image import *
-from ._image import *
+from . import _image
# specific language governing permissions and limitations
# under the License.
"""Image operations."""
-from __future__ import absolute_import as _abs
from . import _make
def resize(data,
# under the License.
#pylint: disable=invalid-name, too-many-lines
"""Neural network operations."""
-from __future__ import absolute_import as _abs
-from ...expr import TupleWrapper
+from tvm.relay import expr
+
from . import _make
from .util import get_pad_tuple2d, get_pad_tuple3d
result : tvm.relay.Expr
The result of dropout
"""
- return TupleWrapper(dropout_raw(data, rate), 2)[0]
+ return expr.TupleWrapper(dropout_raw(data, rate), 2)[0]
def dropout_raw(data, rate=0.5):
epsilon,
center,
scale)
- return TupleWrapper(result, 3)
+ return expr.TupleWrapper(result, 3)
def instance_norm(data,
Tuple of output sparse tensor (same shape and format as input),
i.e. if CSR then output is in ([data, indices, indptr]) form
"""
- return TupleWrapper(_make.sparse_transpose(x.data, x.indices, x.indptr), 3)
+ return expr.TupleWrapper(
+ _make.sparse_transpose(x.data, x.indices, x.indptr), 3)
def contrib_conv2d_winograd_without_weight_transform(data,
weight,
# specific language governing permissions and limitations
# under the License.
"""Multibox operations."""
+from tvm.relay import expr
from . import _make
-from ...expr import TupleWrapper
+
def multibox_prior(data,
sizes=(1.0,),
-------
ret : tuple of tvm.relay.Expr
"""
- return TupleWrapper(_make.multibox_transform_loc(cls_prob, loc_pred,
- anchor, clip, threshold,
- variances), 2)
+ return expr.TupleWrapper(
+ _make.multibox_transform_loc(cls_prob, loc_pred,
+ anchor, clip, threshold,
+ variances), 2)
# specific language governing permissions and limitations
# under the License.
"""Non-maximum suppression operations."""
+from tvm.relay import expr
from . import _make
-from ...expr import TupleWrapper
+
def get_valid_counts(data,
score_threshold,
out_tensor : relay.Expr
Rearranged data tensor.
"""
- return TupleWrapper(_make.get_valid_counts(data, score_threshold,
- id_index, score_index), 2)
+ return expr.TupleWrapper(
+ _make.get_valid_counts(data, score_threshold,
+ id_index, score_index), 2)
def non_max_suppression(data,
from tvm import te
import tvm.relay as relay
import tvm.relay.op as op
-from tvm.relay import transform
-from tvm.relay import Function, GlobalVar, ScopeBuilder, Tuple, TupleGetItem, create_executor
-from tvm.relay import TensorType, TupleType
+
from . import mlp
from . import resnet
def run_infer_type(expr):
- return run_opt_pass(expr, transform.InferType())
+ return run_opt_pass(expr, relay.transform.InferType())
def _np_randn_from_type(t, scale=1, mean=0):
"""Given a Relay prelude, adds a Peano nat ADT, as well as functions
for adding nats and doubling nats. It also adds versions of
update, nth, and iterate that take nats instead of scalars (the
- names are prefixed with 'nat_')."""
+ names are prefixed with `nat_`)."""
define_nat_adt(prelude)
define_nat_double(prelude)
define_nat_add(prelude)