Пример #1
0
        static public TensorShape Reduce(this TensorShape shape, int axis)
        {
            axis = shape.Axis(axis);
            var newShapeArray = shape.ToArray();

            newShapeArray[axis] = 1;
            return(new TensorShape(newShapeArray));
        }
Пример #2
0
 /// <summary>
 /// Allow to use negative axis to access tensorShape backward.
 /// `axis` should be from -rank to rank (exclusive).
 /// </summary>
 public int Axis(int axis)
 {
     return(shape.Axis(axis));
 }