nnvm.top

Tensor operator property registry

Provide information to lower and schedule tensor operators.

nnvm.top.register_compute(op_name, f=None, level=10)

Register compute function for operator

Parameters:
  • op_name (str) – The name of operator
  • f (function) – The schedule function
  • level (int) – The priority level
Returns:

fregister – Register function if f is not specified.

Return type:

function

nnvm.top.register_schedule(op_name, f=None, level=10)

Register schedule function for operator

Parameters:
  • op_name (str) – The name of operator
  • f (function) – The schedule function
  • level (int) – The priority level
Returns:

fregister – Register function if f is not specified.

Return type:

function

nnvm.top.register_pattern(op_name, pattern, level=10)

Register pattern code for operator

Parameters:
  • op_name (str) – The name of operator
  • pattern (int) – The pattern code.
  • level (int) – The priority level
class nnvm.top.AttrDict(handle)

Attribute dictionary in nnvm.

Used by python registration of compute and schedule function. AttrDict is passed as the first argument to schedule and compute function.

get_bool(key)

Get bool from attr dict

Parameters:key (str) – The attr key
Returns:value – The result value
Return type:bool
get_float(key)

Get float from attr dict

Parameters:key (str) – The attr key
Returns:value – The result value
Return type:float
get_int(key)

Get integer from attr dict

Parameters:key (str) – The attr key
Returns:value – The result value
Return type:int
get_int_pair_tuple(key)

Get tuple of integer pairs from attr dict

Parameters:key (str) – The attr key
Returns:tuple – The result tuple
Return type:tuple of int pairs
get_int_tuple(key)

Get tuple of integer from attr dict

Parameters:key (str) – The attr key
Returns:tuple – The result tuple
Return type:tuple of int
get_string(key)

Get string from attr dict

Parameters:key (str) – The attr key
Returns:value – The result value
Return type:str
keys()

Get list of keys in the dict.

Returns:keys – List of keys
Return type:list of str