Ejemplo n.º 1
0
def relu(node, name=None):  # type: (NodeInput, str) -> Node
    """Perform rectified linear unit operation on input node element-wise.

    :param node: One of: input node, array or scalar.
    :param name: The optional ouptut node name.
    :return: The new node performing relu operation on its input element-wise.
    """
    return Relu(node)
Ejemplo n.º 2
0
def test_CreateIENetworkFromNGraph():
    element_type = Type.f32
    param = Parameter(element_type, Shape([1, 3, 22, 22]))
    relu = Relu(param)
    func = Function([relu], [param], 'test')
    caps = Function.to_capsule(func)
    cnnNetwork = IENetwork(caps)
    assert cnnNetwork != None
    assert cnnNetwork.get_function() != None
    assert len(cnnNetwork.layers) == 2
Ejemplo n.º 3
0
def test_GetIENetworkFromNGraph():
    element_type = Type.f32
    param = Parameter(element_type, Shape([1, 3, 22, 22]))
    relu = Relu(param)
    func = Function([relu], [param], 'test')
    caps = Function.to_capsule(func)
    cnnNetwork = IENetwork(caps)
    assert cnnNetwork != None
    assert cnnNetwork.get_function() != None
    caps2 = cnnNetwork.get_function()
    func2 = Function.from_capsule(caps2)
    assert func2 != None