def gather_act()

in py/fpga_resnet.py [0:0]


def gather_act(ext, dev, model):
    def append_act(ext, dev, acts, m):
        acts.append(m.getInput())

    acts = []
    for m in [model.conv1, model.relu, model.maxpool]:
        append_act(ext, dev, acts, m)

    for l in [model.layer1, model.layer2, model.layer3, model.layer4]:
        for s in l:
            for m in [s.conv1, s.relu1, s.conv2, s.relu2]:
                append_act(ext, dev, acts, m)
            if (hasattr(s, 'conv3')):
                append_act(ext, act, acts, s.conv3)
            if (s.downsample):
                append_act(ext, act, acts, s.downsample)
            append_act(ext, act, acts, s.add)

    for m in [model.avgpool, model.fc]:
        append_act(ext, dev, acts, m)

    return acts