Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tvm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cld
ml
tvm
Commits
399b39f1
Commit
399b39f1
authored
6 years ago
by
雾雨魔理沙
Committed by
Tianqi Chen
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fix pydoc format (#1975)
parent
155e955f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
python/tvm/relay/ty.py
+34
-20
34 additions, 20 deletions
python/tvm/relay/ty.py
with
34 additions
and
20 deletions
python/tvm/relay/ty.py
+
34
−
20
View file @
399b39f1
...
...
@@ -31,11 +31,17 @@ class TensorType(Type):
Parameters
----------
shape: List[tvm.Expr]
shape
: List[tvm.Expr]
The shape of the Tensor
dtype:
str, o
ptional
dtype
:
O
ptional
[str]
The content data type.
Default to
"
float32
"
.
Returns
-------
tensor_type : tvm.relay.TensorType
The tensor type.
"""
def
__init__
(
self
,
shape
,
dtype
=
"
float32
"
):
self
.
__init_handle_by_constructor__
(
...
...
@@ -57,10 +63,10 @@ class Kind(IntEnum):
@register_relay_node
class
TypeVar
(
Type
):
"""
A type
p
ar
ameter
used for generic types in Relay,
"""
A type
v
ar
iable
used for generic types in Relay,
see tvm/relay/type.h for more details.
A type
p
ar
ameter
represents a type placeholder which will
A type
v
ar
iable
represents a type placeholder which will
be filled in later on. This allows the user to write
functions which are generic over types.
"""
...
...
@@ -70,16 +76,17 @@ class TypeVar(Type):
Parameters
----------
var: tvm.expr.Var
var
: tvm.expr.Var
The tvm.Var which backs the type parameter.
kind
: Kind, o
ptional
kind
: O
ptional
[Kind]
The kind of the type parameter.
Default to Kind.Type.
Returns
-------
type_
p
ar
am:
TypeVar
The type
p
ar
ameter
.
type_
v
ar
: tvm.relay.
TypeVar
The type
v
ar
iable
.
"""
self
.
__init_handle_by_constructor__
(
_make
.
TypeVar
,
var
,
kind
)
...
...
@@ -102,11 +109,13 @@ class TupleType(Type):
Parameters
----------
fields: List[tvm.relay.Type]
fields : List[tvm.relay.Type]
The fields in the tuple
Returns
-------
tuple_type: the tuple type
tuple_type : tvm.relay.TupleType
the tuple type
"""
self
.
__init_handle_by_constructor__
(
_make
.
TupleType
,
fields
)
...
...
@@ -125,16 +134,16 @@ class FuncType(Type):
Parameters
----------
arg_types: List[tvm.relay.Type]
arg_types
: List[tvm.relay.Type]
The argument types
ret_type: tvm.relay.Type
ret_type
: tvm.relay.Type
The return type.
type_params: List[tvm.relay.TypeVar]
type_params
:
Optional[
List[tvm.relay.TypeVar]
]
The type parameters
type_constraints: List[tvm.relay.TypeConstraint]
type_constraints
:
Optional[
List[tvm.relay.TypeConstraint]
]
The type constraints.
"""
def
__init__
(
self
,
...
...
@@ -163,18 +172,23 @@ class TypeRelation(TypeConstraint):
Parameters
----------
func: EnvFunc
func
: EnvFunc
User defined relation function.
args:
list of t
ype
s
args
:
[tvm.relay.T
ype
]
List of types to the func.
num_inputs: int
num_inputs
: int
Number of input arguments in args,
this act as a hint for type inference.
attrs: Attrs
attrs
: Attrs
The attribute attached to the relation information
Returns
-------
type_relation : tvm.relay.TypeRelation
The type relation.
"""
def
__init__
(
self
,
func
,
args
,
num_inputs
,
attrs
):
self
.
__init_handle_by_constructor__
(
_make
.
TypeRelation
,
...
...
@@ -188,12 +202,12 @@ def scalar_type(dtype):
Parameters
----------
dtype: str
dtype
: str
The content data type.
Returns
-------
s_type: tvm.relay.TensorType
s_type
: tvm.relay.TensorType
The result type.
"""
return
TensorType
((),
dtype
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment