user21
user21

Reputation: 329

definition of caffe.Layer class

When defining a python layer in Caffe like this, there are fields like voc_dir, split,random, etc, some of them are said to inherit from caffe.Layer class.

However where can I find the definition of caffe.Layer class? Searched through Caffe's documentation but they provide very little explanation, and didn't find it after looking in several directories in their code base.

Upvotes: 1

Views: 72

Answers (1)

rkellerm
rkellerm

Reputation: 5512

The Layer class is implemented in the (core) C++ code of caffe. (link)
The Boost Python wrapper defines the interface as follows, in python/_caffe.cpp (which is compiled to python/caffe/_caffe.so):

bp::class_<Layer<Dtype>, shared_ptr<PythonLayer<Dtype> >,
boost::noncopyable>("Layer", bp::init<const LayerParameter&>())

This interface is then imported by the caffe module init:

from ._caffe import init_log, log, set_mode_cpu, set_mode_gpu, set_device, **Layer**

Upvotes: 2

Related Questions