2using System.Collections.Generic;
70 float[] rgIdxF =
null;
71 List<int> rgDim =
new List<int>(colBottom[0].shape());
73 if (colBottom.
Count > 1)
74 rgIdxF =
convertF(colBottom[1].mutable_cpu_data);
76 List<int> rgIdx =
new List<int>();
80 m_log.
WriteLine(
"WARNING: Squeeze indexes specified in as blob input data, squeeze parameters will be ignored.");
82 for (
int i = 0; i < rgIdxF.Length; i++)
84 rgIdx.Add((
int)rgIdxF[i]);
92 rgIdx = rgIdx.OrderBy(p => p).ToList();
94 for (
int i = 0; i < rgIdx.Count; i++)
98 if (nAxis >= rgDim.Count)
101 rgDim.Insert(nAxis, 1);
105 colTop[0].ShareData(colBottom[0]);
106 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.
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 UnsqueezeLayer performs an unsqueeze operation where a single dimension is inserted at each index...
override int ExactNumTopBlobs
Returns the exact number of required top (output) Blobs: flatten
override void forward(BlobCollection< T > colBottom, BlobCollection< T > colTop)
Not implemented - squeeze Layers do not perform forward.
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.
UnsqueezeLayer(CudaDnn< T > cuda, Log log, LayerParameter p)
The UnsqueezeLayer constructor.
override void Reshape(BlobCollection< T > colBottom, BlobCollection< T > colTop)
Reshape the top (output) blob.
override void backward(BlobCollection< T > colTop, List< bool > rgbPropagateDown, BlobCollection< T > colBottom)
Not implemented - squeeze Layers do not perform backward.
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-...