neon.data.ticker.Task

class neon.data.ticker.Task(name=None)[source]

Bases: neon.NervanaObject

Base class from which ticker tasks inherit.

__init__(name=None)

Class constructor.

Parameters:name (str, optional) – Name to assign instance of this class.

Methods

__init__([name]) Class constructor.
fetch_io(time_steps) Generate inputs, outputs numpy tensor pair of size appropriate for this minibatch.
fill_buffers(time_steps, inputs, outputs, …) Prepare data for delivery to device.
gen_class(pdict)
get_description([skip]) Returns a dict that contains all necessary information needed to serialize this object.
recursive_gen(pdict, key) helper method to check whether the definition
be = None
classnm

Returns the class name.

fetch_io(time_steps)[source]

Generate inputs, outputs numpy tensor pair of size appropriate for this minibatch.

Parameters:time_steps (int) – Number of time steps in this minibatch.
Returns:(input, output) tuple of numpy arrays.
Return type:tuple
fill_buffers(time_steps, inputs, outputs, in_tensor, out_tensor, mask)[source]

Prepare data for delivery to device.

Parameters:
  • time_steps (int) – Number of time steps in this minibatch.
  • inputs (numpy array) – Inputs numpy array
  • outputs (numpy array) – Outputs numpy array
  • in_tensor (Tensor) – Device buffer holding inputs
  • out_tensor (Tensor) – Device buffer holding outputs
  • mask (numpy array) – Device buffer for the output mask
gen_class(pdict)
get_description(skip=[], **kwargs)

Returns a dict that contains all necessary information needed to serialize this object.

Parameters:skip (list) – Objects to omit from the dictionary.
Returns:Dictionary format for object information.
Return type:(dict)
modulenm

Returns the full module path.

recursive_gen(pdict, key)

helper method to check whether the definition dictionary is defining a NervanaObject child, if so it will instantiate that object and replace the dictionary element with an instance of that object