HybridLambda

class HybridLambda(function, prefix=None)

Wraps an operator or an expression as a HybridBlock 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 both symbol and ndarray. For example:

block = HybridLambda('tanh')
  1. A function that conforms to def function(F, data, *args). For example:

    block = HybridLambda(lambda F, x: F.LeakyReLU(x, slope=0.1))
    
Inputs:
  • ** args *: one or more input data. First argument must be symbol or ndarray. Their
    shapes depend on the function.
Output:
  • ** outputs *: one or more output data. Their shapes depend on the function.