Skip to content

Commit

Permalink
[AUTOTVM] typo (apache#2478)
Browse files Browse the repository at this point in the history
* [AUTOTVM] typo

* trigger CI
  • Loading branch information
eqy authored and Wei Chen committed Feb 20, 2019
1 parent 6698395 commit e2a7dee
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions python/tvm/autotvm/task/topi_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from ..util import get_const_tuple

# A table that records all registered dispatcher for all targets
_REGISTED_DISPATHCER = {
_REGISTERED_DISPATCHER = {
}


Expand Down Expand Up @@ -210,7 +210,7 @@ def get():
def register_topi_compute(topi_compute, target_keys, template_keys, func=None):
"""Register a tunable template for a topi compute function.
After the registration. This topi compute will become a configuration dispatcher. It uses
After the registration, this topi compute will become a configuration dispatcher. It uses
all its argument as workload and dispatches configurations according to the input workload.
It also stores this "workload" to its final ComputeOp, which can be used to reconstruct
Expand Down Expand Up @@ -243,18 +243,18 @@ def register_topi_compute(topi_compute, target_keys, template_keys, func=None):
def _decorator(f):
targets = [target_keys] if isinstance(target_keys, str) else target_keys
for target_key in targets:
if target_key not in _REGISTED_DISPATHCER:
_REGISTED_DISPATHCER[target_key] = {}
if topi_compute not in _REGISTED_DISPATHCER[target_key]:
if target_key not in _REGISTERED_DISPATCHER:
_REGISTERED_DISPATCHER[target_key] = {}
if topi_compute not in _REGISTERED_DISPATCHER[target_key]:
@topi_compute.register(target_key)
@dispatcher
def config_dispatcher(*args, **kwargs):
"""override topi call as a config dispatcher"""
assert not kwargs, "Do not support kwargs in template function call"
return args_to_workload(args, topi_compute)
_REGISTED_DISPATHCER[target_key][topi_compute] = config_dispatcher
_REGISTERED_DISPATCHER[target_key][topi_compute] = config_dispatcher

config_dispatcher = _REGISTED_DISPATHCER[target_key][topi_compute]
config_dispatcher = _REGISTERED_DISPATCHER[target_key][topi_compute]

@config_dispatcher.register(template_keys)
def template_call(cfg, *args, **kwargs):
Expand Down Expand Up @@ -331,9 +331,9 @@ def register_topi_schedule(topi_schedule, target_keys, template_keys, func=None)
def _decorator(f):
targets = [target_keys] if isinstance(target_keys, str) else target_keys
for target_key in targets:
if target_key not in _REGISTED_DISPATHCER:
_REGISTED_DISPATHCER[target_key] = {}
if topi_schedule not in _REGISTED_DISPATHCER[target_key]:
if target_key not in _REGISTERED_DISPATCHER:
_REGISTERED_DISPATCHER[target_key] = {}
if topi_schedule not in _REGISTERED_DISPATCHER[target_key]:
@topi_schedule.register(target_key)
@dispatcher
def config_dispatcher(outs, *args, **kwargs):
Expand All @@ -357,9 +357,9 @@ def traverse(tensors):

return args_to_workload(workload)

_REGISTED_DISPATHCER[target_key][topi_schedule] = config_dispatcher
_REGISTERED_DISPATCHER[target_key][topi_schedule] = config_dispatcher

config_dispatcher = _REGISTED_DISPATHCER[target_key][topi_schedule]
config_dispatcher = _REGISTERED_DISPATCHER[target_key][topi_schedule]

@config_dispatcher.register(template_keys)
def template_call(cfg, outs, *args, **kwargs):
Expand Down

0 comments on commit e2a7dee

Please sign in to comment.