////////////////////////////////////////////////////////////////////////////////////////////////////
        /// <summary>   Sets up the slice. </summary>
        ///
        /// <param name="param">        The parameter. </param>
        /// <param name="name">         The name. </param>
        /// <param name="inputNames">   List of names of the inputs. </param>
        /// <param name="outputNames">  List of names of the outputs. </param>
        ///
        /// <returns>   A Function. </returns>
        ////////////////////////////////////////////////////////////////////////////////////////////////////

        static Function SetupSlice(SliceParameter param, string name, string[] inputNames, string[] outputNames)
        {
            int[] slicePoints = new int[param.SlicePoints.Length];

            for (int i = 0; i < slicePoints.Length; i++)
            {
                slicePoints[i] = (int)param.SlicePoints[i];
            }

            // Caffe and Chainer implicitly use the first dimension as Bacth, so make correction
            return(new SplitAxis(slicePoints, param.Axis - 1, name, inputNames, outputNames));
        }
示例#2
0
        static Function SetupSlice(SliceParameter param, string name, string[] inputNames, string[] outputNames)
        {
            int[] slicePoints = new int[param.SlicePoints.Length];

            for (int i = 0; i < slicePoints.Length; i++)
            {
                slicePoints[i] = (int)param.SlicePoints[i];
            }

            //Caffe及びChainerは暗黙的に1次元目をBacthとして利用しているため補正を行う
            return(new SplitAxis(slicePoints, param.Axis - 1, name, inputNames, outputNames));
        }