Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Relay] Fix type var docs in Python #4208

Merged
merged 1 commit into from
Oct 28, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions python/tvm/relay/ty.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ def __call__(self, *args):
class TensorType(Type):
"""A concrete TensorType in Relay.

This is the type assigned to tensor's with a known dype and shape. For
example a tensor of `float32` and `(5, 5)`.
This is the type assigned to tensors with a known dtype and shape. For
example, a tensor of `float32` and `(5, 5)`.

Parameters
----------
Expand Down Expand Up @@ -119,13 +119,14 @@ class TypeVar(Type):
functions which are generic over types.
"""

def __init__(self, var, kind=Kind.Type):
def __init__(self, name_hint, kind=Kind.Type):
"""Construct a TypeVar.

Parameters
----------
var : tvm.expr.Var
The tvm.Var which backs the type parameter.
name_hint: str
The name of the type variable. This name only acts as a hint, and
is not used for equality.

kind : Optional[Kind]
The kind of the type parameter.
Expand All @@ -136,7 +137,7 @@ def __init__(self, var, kind=Kind.Type):
type_var : tvm.relay.TypeVar
The type variable.
"""
self.__init_handle_by_constructor__(_make.TypeVar, var, kind)
self.__init_handle_by_constructor__(_make.TypeVar, name_hint, kind)

def ShapeVar(name):
"""A helper which constructs a type var of which the shape kind.
Expand All @@ -159,13 +160,15 @@ class GlobalTypeVar(Type):
stored in the environment.
"""

def __init__(self, var, kind=Kind.AdtHandle):
def __init__(self, name_hint, kind=Kind.AdtHandle):
"""Construct a GlobalTypeVar.

Parameters
----------
var: tvm.Var
The tvm.Var which backs the type parameter.
name_hint: str
The name of the global type variable. This name only acts as a
hint, and is not used for equality.

kind: Kind, optional
The kind of the type parameter, Kind.AdtHandle by default.

Expand All @@ -174,7 +177,7 @@ def __init__(self, var, kind=Kind.AdtHandle):
type_var: GlobalTypeVar
The global type variable.
"""
self.__init_handle_by_constructor__(_make.GlobalTypeVar, var, kind)
self.__init_handle_by_constructor__(_make.GlobalTypeVar, name_hint, kind)


@register_relay_node
Expand Down