2using System.Collections.Generic;
76 List<int> rgTopShape =
Utility.Clone<
int>(colBottom[0].shape());
77 rgTopShape[m_nAxis] = colBottom[0].shape(m_nAxis) * m_nTiles;
80 m_nOuterDim = colBottom[0].count(0, m_nAxis);
81 m_nInnerDim = colBottom[0].count(m_nAxis);
95 long hBottomData = colBottom[0].gpu_data;
96 long hTopData = colTop[0].mutable_gpu_data;
97 int bottom_tile_axis = colBottom[0].shape(m_nAxis);
98 int nCount = colTop[0].count();
100 m_cuda.tile_fwd(nCount, hBottomData, m_nInnerDim, m_nTiles, bottom_tile_axis, hTopData);
113 if (!rgbPropagateDown[0])
116 long hTopDiff = colTop[0].gpu_diff;
117 long hBottomDiff = colBottom[0].mutable_gpu_diff;
118 int bottom_tile_axis = colBottom[0].shape(m_nAxis);
119 int tile_size = m_nInnerDim / bottom_tile_axis;
120 int nCount = colBottom[0].count();
122 m_cuda.tile_bwd(nCount, hTopDiff, tile_size, m_nTiles, bottom_tile_axis, hBottomDiff);
The Log class provides general output in text form.
void CHECK_GT(double df1, double df2, string str)
Test whether one number is greater than another.
The Utility class provides general utility funtions.
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.
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.
The TileLayer copies a Blob along specified dimensions. This layer is initialized with the MyCaffe....
override void Reshape(BlobCollection< T > colBottom, BlobCollection< T > colTop)
Reshape the bottom (input) and top (output) blobs.
TileLayer(CudaDnn< T > cuda, Log log, LayerParameter p)
The TileLayer constructor.
override void backward(BlobCollection< T > colTop, List< bool > rgbPropagateDown, BlobCollection< T > colBottom)
Computes the error gradient w.r.t the inputs.
override int ExactNumTopBlobs
Returns the exact number of required top (output) Blobs: tile.
override void forward(BlobCollection< T > colBottom, BlobCollection< T > colTop)
Computes the forward calculation.
override int ExactNumBottomBlobs
Returns the exact number of required bottom (input) Blobs: input.
override void LayerSetUp(BlobCollection< T > colBottom, BlobCollection< T > colTop)
Setup the layer.
Specifies the base parameter for all layers.
TileParameter tile_param
Returns the parameter set when initialized with LayerType.TILE
LayerType
Specifies the layer type.
int tiles
Specifies the number of copies (tiles) of the blob to output.
int axis
Specifies the index of the axis to tile.
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-...