2using System.Collections.Generic;
70 float[] rgIdxF =
null;
72 if (colBottom.
Count > 1)
73 rgIdxF =
convertF(colBottom[1].mutable_cpu_data);
75 List<int> rgIdx =
new List<int>();
79 m_log.
WriteLine(
"WARNING: Squeeze indexes specified in as blob input data, squeeze parameters will be ignored.");
81 for (
int i = 0; i < rgIdxF.Length; i++)
83 rgIdx.Add((
int)rgIdxF[i]);
91 List<int> rgDim =
new List<int>();
94 for (
int i = 0; i < colBottom[0].shape().Count; i++)
96 int nDim = colBottom[0].shape()[i];
102 else if (rgIdx !=
null && rgIdx.Count > 0)
104 if (nIdx >= rgIdx.Count)
110 if (rgIdx[nIdx] != i)
118 colTop[0].ShareData(colBottom[0]);
119 colTop[0].ShareDiff(colBottom[0]);
The Log class provides general output in text form.
void WriteLine(string str, bool bOverrideEnabled=false, bool bHeader=false, bool bError=false, bool bDisable=false)
Write a line of output.
The BlobCollection contains a list of Blobs.
void Add(Blob< T > b)
Add a new Blob to the collection.
int Count
Returns the number of items in the collection.
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.
float convertF(T df)
Converts a generic to a float value.
virtual bool reshapeNeeded(BlobCollection< T > colBottom, BlobCollection< T > colTop, bool bReset=true)
Tests the shapes of both the bottom and top blobs and if they are the same as the previous sizing,...
LayerParameter.LayerType m_type
Specifies the Layer type.
The SqueezeLayer performs a squeeze operation where all single dimensions are removed.
SqueezeLayer(CudaDnn< T > cuda, Log log, LayerParameter p)
The SqueezeLayer constructor.
override void LayerSetUp(BlobCollection< T > colBottom, BlobCollection< T > colTop)
Setup the layer.
override void Reshape(BlobCollection< T > colBottom, BlobCollection< T > colTop)
Reshape the top (output) blob.
override void forward(BlobCollection< T > colBottom, BlobCollection< T > colTop)
Not implemented - squeeze Layers do not perform forward.
override void backward(BlobCollection< T > colTop, List< bool > rgbPropagateDown, BlobCollection< T > colBottom)
Not implemented - squeeze Layers do not perform backward.
override int ExactNumTopBlobs
Returns the exact number of required top (output) Blobs: flatten
override int ExactNumBottomBlobs
Returns the exact number of required bottom (input) Blobs: input.
Specifies the base parameter for all layers.
SqueezeParameter squeeze_param
Returns the parameter set when initialized with LayerType.RESHAPE
LayerType
Specifies the layer type.
List< int > axes
Specifies the axes to remove if dim=1 on squeeze, or add dim=1 on unsqueeze.
The MyCaffe.basecode contains all generic types used throughout MyCaffe.
The MyCaffe.common namespace contains common MyCaffe classes.
The MyCaffe.layers.beta namespace contains all beta stage layers.
The MyCaffe.param.beta parameters are used by the MyCaffe.layer.beta layers.
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-...