Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tic
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wenyuanbo
tic
Commits
399b39f1
Commit
399b39f1
authored
Oct 24, 2018
by
雾雨魔理沙
Committed by
Tianqi Chen
Oct 24, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix pydoc format (#1975)
parent
155e955f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
20 deletions
+34
-20
python/tvm/relay/ty.py
+34
-20
No files found.
python/tvm/relay/ty.py
View file @
399b39f1
...
@@ -31,11 +31,17 @@ class TensorType(Type):
...
@@ -31,11 +31,17 @@ class TensorType(Type):
Parameters
Parameters
----------
----------
shape: List[tvm.Expr]
shape
: List[tvm.Expr]
The shape of the Tensor
The shape of the Tensor
dtype
: str, optional
dtype
: Optional[str]
The content data type.
The content data type.
Default to "float32".
Returns
-------
tensor_type : tvm.relay.TensorType
The tensor type.
"""
"""
def
__init__
(
self
,
shape
,
dtype
=
"float32"
):
def
__init__
(
self
,
shape
,
dtype
=
"float32"
):
self
.
__init_handle_by_constructor__
(
self
.
__init_handle_by_constructor__
(
...
@@ -57,10 +63,10 @@ class Kind(IntEnum):
...
@@ -57,10 +63,10 @@ class Kind(IntEnum):
@register_relay_node
@register_relay_node
class
TypeVar
(
Type
):
class
TypeVar
(
Type
):
"""A type
parameter
used for generic types in Relay,
"""A type
variable
used for generic types in Relay,
see tvm/relay/type.h for more details.
see tvm/relay/type.h for more details.
A type
parameter
represents a type placeholder which will
A type
variable
represents a type placeholder which will
be filled in later on. This allows the user to write
be filled in later on. This allows the user to write
functions which are generic over types.
functions which are generic over types.
"""
"""
...
@@ -70,16 +76,17 @@ class TypeVar(Type):
...
@@ -70,16 +76,17 @@ class TypeVar(Type):
Parameters
Parameters
----------
----------
var: tvm.expr.Var
var
: tvm.expr.Var
The tvm.Var which backs the type parameter.
The tvm.Var which backs the type parameter.
kind
: Kind, optional
kind
: Optional[Kind]
The kind of the type parameter.
The kind of the type parameter.
Default to Kind.Type.
Returns
Returns
-------
-------
type_
param:
TypeVar
type_
var : tvm.relay.
TypeVar
The type
parameter
.
The type
variable
.
"""
"""
self
.
__init_handle_by_constructor__
(
_make
.
TypeVar
,
var
,
kind
)
self
.
__init_handle_by_constructor__
(
_make
.
TypeVar
,
var
,
kind
)
...
@@ -102,11 +109,13 @@ class TupleType(Type):
...
@@ -102,11 +109,13 @@ class TupleType(Type):
Parameters
Parameters
----------
----------
fields: List[tvm.relay.Type]
fields : List[tvm.relay.Type]
The fields in the tuple
Returns
Returns
-------
-------
tuple_type: the tuple type
tuple_type : tvm.relay.TupleType
the tuple type
"""
"""
self
.
__init_handle_by_constructor__
(
_make
.
TupleType
,
fields
)
self
.
__init_handle_by_constructor__
(
_make
.
TupleType
,
fields
)
...
@@ -125,16 +134,16 @@ class FuncType(Type):
...
@@ -125,16 +134,16 @@ class FuncType(Type):
Parameters
Parameters
----------
----------
arg_types: List[tvm.relay.Type]
arg_types
: List[tvm.relay.Type]
The argument types
The argument types
ret_type: tvm.relay.Type
ret_type
: tvm.relay.Type
The return type.
The return type.
type_params
: List[tvm.relay.TypeVar
]
type_params
: Optional[List[tvm.relay.TypeVar]
]
The type parameters
The type parameters
type_constraints
: List[tvm.relay.TypeConstraint
]
type_constraints
: Optional[List[tvm.relay.TypeConstraint]
]
The type constraints.
The type constraints.
"""
"""
def
__init__
(
self
,
def
__init__
(
self
,
...
@@ -163,18 +172,23 @@ class TypeRelation(TypeConstraint):
...
@@ -163,18 +172,23 @@ class TypeRelation(TypeConstraint):
Parameters
Parameters
----------
----------
func: EnvFunc
func
: EnvFunc
User defined relation function.
User defined relation function.
args
: list of types
args
: [tvm.relay.Type]
List of types to the func.
List of types to the func.
num_inputs: int
num_inputs
: int
Number of input arguments in args,
Number of input arguments in args,
this act as a hint for type inference.
this act as a hint for type inference.
attrs: Attrs
attrs
: Attrs
The attribute attached to the relation information
The attribute attached to the relation information
Returns
-------
type_relation : tvm.relay.TypeRelation
The type relation.
"""
"""
def
__init__
(
self
,
func
,
args
,
num_inputs
,
attrs
):
def
__init__
(
self
,
func
,
args
,
num_inputs
,
attrs
):
self
.
__init_handle_by_constructor__
(
_make
.
TypeRelation
,
self
.
__init_handle_by_constructor__
(
_make
.
TypeRelation
,
...
@@ -188,12 +202,12 @@ def scalar_type(dtype):
...
@@ -188,12 +202,12 @@ def scalar_type(dtype):
Parameters
Parameters
----------
----------
dtype: str
dtype
: str
The content data type.
The content data type.
Returns
Returns
-------
-------
s_type: tvm.relay.TensorType
s_type
: tvm.relay.TensorType
The result type.
The result type.
"""
"""
return
TensorType
((),
dtype
)
return
TensorType
((),
dtype
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment