Hi,wang wei~
    When I try to modify interface about GPU interfaces,I find some questions 
should be discussed.

My solution:

xxx layer:

ComputeFeature() {
   Tensor<xpu, 2> data    //  some places use tensor class
   blob<xpu,float> data_   // some places use blob class,and suppose I have 
added a device template parameter into blob class.
}

ComputeGradient() {
                        //the same as ComputeFeature function
}


Some disadvantages:
   All layer classes must be changed,and it spends too much on the change of 
code.

eg.

template<typename xpu>
class Param {
}

template<typename xpu>
class XXXLayer {

 protected:
   Blob<float,xpu> data_;
   shared_ptr<Param<xpu>> weight_, bias_;   
   ........                                 

} 

    What dou you think ? And if you have a good idea,please let me know.
    thanks~

Reply via email to