diff options
author | Jonathan L Long <jonlong@cs.berkeley.edu> | 2015-07-23 20:40:02 -0700 |
---|---|---|
committer | Jonathan L Long <jonlong@cs.berkeley.edu> | 2015-07-23 20:50:34 -0700 |
commit | b464a6e5d2e381185bd8aa0b9cbcba53c9819585 (patch) | |
tree | e1d716662b794c39b38b4bdac65bada06b6c6fe3 /python | |
parent | 96c2fe1de80c9752b992c4578a3ce46028d21fc5 (diff) | |
download | caffeonacl-b464a6e5d2e381185bd8aa0b9cbcba53c9819585.tar.gz caffeonacl-b464a6e5d2e381185bd8aa0b9cbcba53c9819585.tar.bz2 caffeonacl-b464a6e5d2e381185bd8aa0b9cbcba53c9819585.zip |
[pycaffe] net spec layers can have ntop=0
In this case, the Function is returned instead of a Top, which can be
assigned a name if desired.
Thanks @philkr for an earlier implementation of this.
Diffstat (limited to 'python')
-rw-r--r-- | python/caffe/net_spec.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/python/caffe/net_spec.py b/python/caffe/net_spec.py index 16f30008..31cde7ad 100644 --- a/python/caffe/net_spec.py +++ b/python/caffe/net_spec.py @@ -188,7 +188,9 @@ class Layers(object): def __getattr__(self, name): def layer_fn(*args, **kwargs): fn = Function(name, args, kwargs) - if fn.ntop == 1: + if fn.ntop == 0: + return fn + elif fn.ntop == 1: return fn.tops[0] else: return fn.tops |