2using System.Collections.Generic;
74 m_log.
CHECK(colTop[0] != colBottom[0],
"Layer does not allow in-place computation.");
96 m_log.
CHECK_EQ(colTop[0].count(), colBottom[0].count(),
"The top[0] and bottom[0] should have the same count.");
110 m_cuda.copy(colTop[0].count(), colBottom[0].gpu_data, colTop[0].mutable_gpu_data);
124 m_cuda.copy(colBottom[0].count(), colTop[0].gpu_diff, colBottom[0].mutable_gpu_diff);
The Log class provides general output in text form.
void CHECK(bool b, string str)
Test a flag for true.
void CHECK_EQ(double df1, double df2, string str)
Test whether one number is equal to another.
The BlobCollection contains a list of Blobs.
void Reshape(int[] rgShape)
Reshapes all blobs in the collection to the given shape.
The CudaDnn object is the main interface to the Low-Level Cuda C++ DLL.
The FlattenLayer reshapes the input Blob into flat vectors This layer is initialized with the MyCaffe...
FlattenLayer(CudaDnn< T > cuda, Log log, LayerParameter p)
The FlattenLayer constructor.
override void LayerSetUp(BlobCollection< T > colBottom, BlobCollection< T > colTop)
Setup the layer.
override void forward(BlobCollection< T > colBottom, BlobCollection< T > colTop)
Forward computation.
override int ExactNumBottomBlobs
Returns the exact number of required bottom (input) Blobs: input.
override int ExactNumTopBlobs
Returns the exact number of required top (output) Blobs: flatten
override void backward(BlobCollection< T > colTop, List< bool > rgbPropagateDown, BlobCollection< T > colBottom)
Computes the error gradient w.r.t. the concatenate inputs.
override void Reshape(BlobCollection< T > colBottom, BlobCollection< T > colTop)
Reshape the bottom (input) and top (output) blobs.
An interface for the units of computation which can be composed into a Net.
Log m_log
Specifies the Log for output.
LayerParameter m_param
Specifies the LayerParameter describing the Layer.
CudaDnn< T > m_cuda
Specifies the CudaDnn connection to Cuda.
LayerParameter.LayerType m_type
Specifies the Layer type.
Specifies the parameters for the FlattenLayer.
static List< int > Reshape(int nParamAxis, int nParamEndAxis, List< int > rgShape, int nStartAxis=-1, int nEndAxis=-1)
Calculate the reshape array given the parameters.
int axis
Specifies the first axis to flatten: all preceding axes are retained in the output....
int end_axis
Specifies the last axis to flatten: all following axes are retained in the output....
Specifies the base parameter for all layers.
FlattenParameter flatten_param
Returns the parameter set when initialized with LayerType.FLATTEN
LayerType
Specifies the layer type.
The MyCaffe.basecode contains all generic types used throughout MyCaffe.
The MyCaffe.common namespace contains common MyCaffe classes.
The MyCaffe.layers namespace contains all layers that have a solidified code base,...
The MyCaffe.param namespace contains parameters used to create models.
The MyCaffe namespace contains the main body of MyCaffe code that closesly tracks the C++ Caffe open-...