def get_network(name, batch_size):
    'Get the symbol definition and random weight of a network'
    input_shape = (batch_size, 3, 224, 224)
    output_shape = (batch_size, 1000)
    if ('resnet' in name):
        n_layer = int(name.split('-')[1])
        (mod, params) = relay.testing.resnet.get_workload(num_layers=n_layer, batch_size=batch_size, dtype=dtype)
    elif ('vgg' in name):
        n_layer = int(name.split('-')[1])
        (mod, params) = relay.testing.vgg.get_workload(num_layers=n_layer, batch_size=batch_size, dtype=dtype)
    elif (name == 'mobilenet'):
        (mod, params) = relay.testing.mobilenet.get_workload(batch_size=batch_size, dtype=dtype)
    elif (name == 'squeezenet_v1.1'):
        (mod, params) = relay.testing.squeezenet.get_workload(batch_size=batch_size, version='1.1', dtype=dtype)
    elif (name == 'inception_v3'):
        input_shape = (batch_size, 3, 299, 299)
        (mod, params) = relay.testing.inception_v3.get_workload(batch_size=batch_size, dtype=dtype)
    elif (name == 'mxnet'):
        from mxnet.gluon.model_zoo.vision import get_model
        block = get_model('resnet18_v1', pretrained=True)
        (mod, params) = relay.frontend.from_mxnet(block, shape={'data': input_shape}, dtype=dtype)
        net = mod['main']
        net = relay.Function(net.params, relay.nn.softmax(net.body), None, net.type_params, net.attrs)
        mod = tvm.IRModule.from_expr(net)
    else:
        raise ValueError(('Unsupported network: ' + name))
    return (mod, params, input_shape, output_shape)
Get the symbol definition and random weight of a network
def get_network(name, batch_size):
    
    input_shape = (batch_size, 3, 224, 224)
    output_shape = (batch_size, 1000)
    if ('resnet' in name):
        n_layer = int(name.split('-')[1])
        (mod, params) = relay.testing.resnet.get_workload(num_layers=n_layer, batch_size=batch_size, dtype=dtype)
    elif ('vgg' in name):
        n_layer = int(name.split('-')[1])
        (mod, params) = relay.testing.vgg.get_workload(num_layers=n_layer, batch_size=batch_size, dtype=dtype)
    elif (name == 'mobilenet'):
        (mod, params) = relay.testing.mobilenet.get_workload(batch_size=batch_size, dtype=dtype)
    elif (name == 'squeezenet_v1.1'):
        (mod, params) = relay.testing.squeezenet.get_workload(batch_size=batch_size, version='1.1', dtype=dtype)
    elif (name == 'inception_v3'):
        input_shape = (batch_size, 3, 299, 299)
        (mod, params) = relay.testing.inception_v3.get_workload(batch_size=batch_size, dtype=dtype)
    elif (name == 'mxnet'):
        from mxnet.gluon.model_zoo.vision import get_model
        block = get_model('resnet18_v1', pretrained=True)
        (mod, params) = relay.frontend.from_mxnet(block, shape={'data': input_shape}, dtype=dtype)
        net = mod['main']
        net = relay.Function(net.params, relay.nn.softmax(net.body), None, net.type_params, net.attrs)
        mod = tvm.IRModule.from_expr(net)
    else:
        raise ValueError(('Unsupported network: ' + name))
    return (mod, params, input_shape, output_shape)