Lambda

class Lambda(function, prefix=None)

Wraps an operator or an expression as a Block object.

Parameters:
function : str or function

Function used in lambda must be one of the following: 1) the name of an operator that is available in ndarray. For example:

block = Lambda('tanh')
  1. a function that conforms to def function(*args). For example:

    block = Lambda(lambda x: nd.LeakyReLU(x, slope=0.1))
    
Inputs:
  • ** args *: one or more input data. Their shapes depend on the function.
Output:
  • ** outputs *: one or more output data. Their shapes depend on the function.