add layer_dict to the python interface #4347

Merged
merged 2 commits into from Feb 17, 2017

Conversation

Projects
None yet
3 participants
Contributor

nitnelave commented Jun 21, 2016

Similar to the blobs map, have a layer map.

This turns
net.layers[list(net._layer_names).index("ip2")]
into
net.layer_dict["ip2"]

Contributor

ajtulloch commented Jun 21, 2016

Sure, seems reasonable to me. Could you add some unit tests?

Contributor

nitnelave commented Jun 21, 2016

I'd be glad to, but where? :) (Sorry, it's my first time contributing to caffe, and I can't seem to find the tests)

Contributor

nitnelave commented Jun 21, 2016

Nevermind, I found them in python/caffe/test

Contributor

nitnelave commented Jun 21, 2016

Here are the tests. To check the equality of the pointed layers, I only checked the types, but since the layers of the test network are all different types anyway, it seemed reasonable.

@shelhamer shelhamer merged commit c510e33 into BVLC:master Feb 17, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment