Beispiel #1
0
    'elemwise_add': _add,
    # Subtraction
    '__sub_scalar__': _subtract,
    '__rsub_scalar__': _rsubtract,
    'broadcast_sub': _subtract,
    'elemwise_sub': _subtract,
    # Multiply
    '__mul_scalar__': _multiply,
    'broadcast_mul': _multiply,
    'elemwise_mul': _multiply,
    # Division
    '__div_scalar__': _divide,
    'broadcast_div': _divide,
    'elemwise_div': _divide,
    # Negative
    'negative': _rename("negative"),

    # Comparsion
    'greater': _greater,
    'greater_equal': _greater_equal,
    'less': _less,
    'less_equal': _less_equal,

    # Activations
    'sigmoid': _rename('sigmoid'),
    'relu': _rename('nn.relu'),
    'exp': _rename('exp'),
    'log': _rename('log'),
    'tanh': _rename('tanh'),
    'leaky_relu': _leaky_relu,
    'clip': _clip,
Beispiel #2
0
NNVM_OP_2_RELAY_OP = {
    'flatten': _nn_batch_flatten,
    'dense': _dense,
    'softmax': _softmax_op(op.nn.softmax),
    'log_softmax': _softmax_op(op.nn.log_softmax),
    'conv2d': _conv2d,
    'batch_norm': _batch_norm,
    'max_pool2d': _max_pool2d,
    'reshape': _reshape,
    'transpose': _transpose,
    'dropout': _dropout,
    'mean': _mean,
    # Addition
    '__add_scalar__': _binop_scalar(op.add),
    'broadcast_add': _rename(op.add),
    'elemwise_add': _rename(op.add),
    # Subtraction
    '__sub_scalar__': _binop_scalar(op.subtract),
    '__rsub_scalar__': _rbinop_scalar(op.subtract),
    'broadcast_sub': _rename(op.subtract),
    'elemwise_sub': _rename(op.subtract),
    # Multiply
    '__mul_scalar__': _binop_scalar(op.multiply),
    'broadcast_mul': _rename(op.multiply),
    'elemwise_mul': _rename(op.multiply),
    # Division
    '__div_scalar__': _binop_scalar(op.divide),
    'broadcast_div': _rename(op.divide),
    'elemwise_div': _rename(op.divide),
    'broadcast_mod': _rename(op.mod),