DiffSharp


Shape Module

Namespace: DiffSharp

Assembly: DiffSharp.Core.dll


Parent Module: Util

Functions and values

Function or value Description
broadcast2 shape1 shape2
Full Usage:
broadcast2 shape1 shape2 Parameter Types:
  • shape1 : Shape
  • shape2 : Shape

Return Type: int []
Signature: shape1: Shape -> shape2: Shape -> int []

Find the shape into which shape1 and shape2 can be expanded


Parameter Types:
  • shape1 : Shape
  • shape2 : Shape
Return Type: int []
broadcastShapes shapes
Full Usage:
broadcastShapes shapes Parameter Types:
  • shapes : Shape []

Return Type: Shape
Signature: shapes: Shape [] -> Shape

Find the shape into which all the shapes can be expanded


Parameter Types:
  • shapes : Shape []
Return Type: Shape
canExpand oldShape newShape
Full Usage:
canExpand oldShape newShape Parameter Types:
  • oldShape : Shape
  • newShape : Shape

Return Type: bool
Signature: oldShape: Shape -> newShape: Shape -> bool
Parameter Types:
  • oldShape : Shape
  • newShape : Shape
Return Type: bool
checkCanAddSlice shape1 location shape2
Full Usage:
checkCanAddSlice shape1 location shape2 Parameter Types:
  • shape1 : Shape
  • location : int []
  • shape2 : Shape

Signature: shape1: Shape -> location: int [] -> shape2: Shape -> unit
Parameter Types:
  • shape1 : Shape
  • location : int []
  • shape2 : Shape
checkCanCat shapes dim
Full Usage:
checkCanCat shapes dim Parameter Types:
  • shapes : Shape []
  • dim : int

Return Type: int * int [] * int * int [] * int []
Signature: shapes: Shape [] -> dim: int -> int * int [] * int * int [] * int []
Parameter Types:
  • shapes : Shape []
  • dim : int
Return Type: int * int [] * int * int [] * int []
checkCanConv1d dtype1 dtype2 shape1 shape2 stride padding dilation
Full Usage:
checkCanConv1d dtype1 dtype2 shape1 shape2 stride padding dilation Parameter Types:
  • dtype1 : Dtype
  • dtype2 : Dtype
  • shape1 : Shape
  • shape2 : Shape
  • stride : int
  • padding : int
  • dilation : int

Return Type: int * int * int * int * int * int []
Signature: dtype1: Dtype -> dtype2: Dtype -> shape1: Shape -> shape2: Shape -> stride: int -> padding: int -> dilation: int -> int * int * int * int * int * int []
Parameter Types:
  • dtype1 : Dtype
  • dtype2 : Dtype
  • shape1 : Shape
  • shape2 : Shape
  • stride : int
  • padding : int
  • dilation : int
Return Type: int * int * int * int * int * int []
checkCanConv2d dtype1 dtype2 shape1 shape2 stride padding dilation
Full Usage:
checkCanConv2d dtype1 dtype2 shape1 shape2 stride padding dilation Parameter Types:
  • dtype1 : Dtype
  • dtype2 : Dtype
  • shape1 : Shape
  • shape2 : Shape
  • stride : int []
  • padding : int []
  • dilation : int []

Return Type: int * int * (int * int) * (int * int * int) * int []
Signature: dtype1: Dtype -> dtype2: Dtype -> shape1: Shape -> shape2: Shape -> stride: int [] -> padding: int [] -> dilation: int [] -> int * int * (int * int) * (int * int * int) * int []
Parameter Types:
  • dtype1 : Dtype
  • dtype2 : Dtype
  • shape1 : Shape
  • shape2 : Shape
  • stride : int []
  • padding : int []
  • dilation : int []
Return Type: int * int * (int * int) * (int * int * int) * int []
checkCanConv3d dtype1 dtype2 shape1 shape2 stride padding dilation
Full Usage:
checkCanConv3d dtype1 dtype2 shape1 shape2 stride padding dilation Parameter Types:
  • dtype1 : Dtype
  • dtype2 : Dtype
  • shape1 : Shape
  • shape2 : Shape
  • stride : int []
  • padding : int []
  • dilation : int []

Return Type: int * int * (int * int * int) * (int * int * int * int) * int []
Signature: dtype1: Dtype -> dtype2: Dtype -> shape1: Shape -> shape2: Shape -> stride: int [] -> padding: int [] -> dilation: int [] -> int * int * (int * int * int) * (int * int * int * int) * int []
Parameter Types:
  • dtype1 : Dtype
  • dtype2 : Dtype
  • shape1 : Shape
  • shape2 : Shape
  • stride : int []
  • padding : int []
  • dilation : int []
Return Type: int * int * (int * int * int) * (int * int * int * int) * int []
checkCanDilate dim dilations
Full Usage:
checkCanDilate dim dilations Parameter Types:
  • dim : int
  • dilations : int []

Signature: dim: int -> dilations: int [] -> unit
Parameter Types:
  • dim : int
  • dilations : int []
checkCanDot shape1 shape2
Full Usage:
checkCanDot shape1 shape2 Parameter Types:
  • shape1 : Shape
  • shape2 : Shape

Signature: shape1: Shape -> shape2: Shape -> unit
Parameter Types:
  • shape1 : Shape
  • shape2 : Shape
checkCanDropout p
Full Usage:
checkCanDropout p Parameter Types:
  • p : double

Signature: p: double -> unit
Parameter Types:
  • p : double
checkCanDropout2d shape p
Full Usage:
checkCanDropout2d shape p Parameter Types:
  • shape : Shape
  • p : double

Signature: shape: Shape -> p: double -> unit
Parameter Types:
  • shape : Shape
  • p : double
checkCanDropout3d shape p
Full Usage:
checkCanDropout3d shape p Parameter Types:
  • shape : Shape
  • p : double

Signature: shape: Shape -> p: double -> unit
Parameter Types:
  • shape : Shape
  • p : double
checkCanExpand oldShape newShape
Full Usage:
checkCanExpand oldShape newShape Parameter Types:
  • oldShape : Shape
  • newShape : Shape

Signature: oldShape: Shape -> newShape: Shape -> unit
Parameter Types:
  • oldShape : Shape
  • newShape : Shape
checkCanFlatten shape startDim endDim
Full Usage:
checkCanFlatten shape startDim endDim Parameter Types:
  • shape : Shape
  • startDim : int
  • endDim : int

Signature: shape: Shape -> startDim: int -> endDim: int -> unit
Parameter Types:
  • shape : Shape
  • startDim : int
  • endDim : int
checkCanFlip dim dims
Full Usage:
checkCanFlip dim dims Parameter Types:
  • dim : int
  • dims : int []

Signature: dim: int -> dims: int [] -> unit
Parameter Types:
  • dim : int
  • dims : int []
checkCanGather shape dim indicesShape indicesDtype
Full Usage:
checkCanGather shape dim indicesShape indicesDtype Parameter Types:
  • shape : Shape
  • dim : int
  • indicesShape : Shape
  • indicesDtype : Dtype

Signature: shape: Shape -> dim: int -> indicesShape: Shape -> indicesDtype: Dtype -> unit
Parameter Types:
  • shape : Shape
  • dim : int
  • indicesShape : Shape
  • indicesDtype : Dtype
checkCanGetSlice shape fullBounds
Full Usage:
checkCanGetSlice shape fullBounds Parameter Types:
  • shape : Shape
  • fullBounds : int [,]

Return Type: int []
Signature: shape: Shape -> fullBounds: int [,] -> int []
Parameter Types:
  • shape : Shape
  • fullBounds : int [,]
Return Type: int []
checkCanMatmul shape1 shape2
Full Usage:
checkCanMatmul shape1 shape2 Parameter Types:
  • shape1 : Shape
  • shape2 : Shape

Signature: shape1: Shape -> shape2: Shape -> unit
Parameter Types:
  • shape1 : Shape
  • shape2 : Shape
checkCanMaxpool1d shape kernelSize stride padding
Full Usage:
checkCanMaxpool1d shape kernelSize stride padding Parameter Types:
  • shape : Shape
  • kernelSize : int
  • stride : int
  • padding : int

Return Type: int * int * int * int * int []
Signature: shape: Shape -> kernelSize: int -> stride: int -> padding: int -> int * int * int * int * int []
Parameter Types:
  • shape : Shape
  • kernelSize : int
  • stride : int
  • padding : int
Return Type: int * int * int * int * int []
checkCanMaxpool2d shape kernelSize stride padding
Full Usage:
checkCanMaxpool2d shape kernelSize stride padding Parameter Types:
  • shape : Shape
  • kernelSize : int []
  • stride : int []
  • padding : int []

Return Type: int * int * (int * int) * (int * int) * (int * int) * int []
Signature: shape: Shape -> kernelSize: int [] -> stride: int [] -> padding: int [] -> int * int * (int * int) * (int * int) * (int * int) * int []
Parameter Types:
  • shape : Shape
  • kernelSize : int []
  • stride : int []
  • padding : int []
Return Type: int * int * (int * int) * (int * int) * (int * int) * int []
checkCanMaxpool3d shape kernelSize stride padding
Full Usage:
checkCanMaxpool3d shape kernelSize stride padding Parameter Types:
  • shape : Shape
  • kernelSize : int []
  • stride : int []
  • padding : int []

Return Type: int * int * (int * int * int) * (int * int * int) * (int * int * int) * int []
Signature: shape: Shape -> kernelSize: int [] -> stride: int [] -> padding: int [] -> int * int * (int * int * int) * (int * int * int) * (int * int * int) * int []
Parameter Types:
  • shape : Shape
  • kernelSize : int []
  • stride : int []
  • padding : int []
Return Type: int * int * (int * int * int) * (int * int * int) * (int * int * int) * int []
checkCanMaxunpool1d shape indicesDtype indicesShape outputSize
Full Usage:
checkCanMaxunpool1d shape indicesDtype indicesShape outputSize Parameter Types:
  • shape : Shape
  • indicesDtype : Dtype
  • indicesShape : Shape
  • outputSize : int []

Return Type: int * int * int * int []
Signature: shape: Shape -> indicesDtype: Dtype -> indicesShape: Shape -> outputSize: int [] -> int * int * int * int []
Parameter Types:
  • shape : Shape
  • indicesDtype : Dtype
  • indicesShape : Shape
  • outputSize : int []
Return Type: int * int * int * int []
checkCanMaxunpool2d shape indicesDtype indicesShape outputSize
Full Usage:
checkCanMaxunpool2d shape indicesDtype indicesShape outputSize Parameter Types:
  • shape : Shape
  • indicesDtype : Dtype
  • indicesShape : Shape
  • outputSize : int []

Return Type: int * int * (int * int) * int []
Signature: shape: Shape -> indicesDtype: Dtype -> indicesShape: Shape -> outputSize: int [] -> int * int * (int * int) * int []
Parameter Types:
  • shape : Shape
  • indicesDtype : Dtype
  • indicesShape : Shape
  • outputSize : int []
Return Type: int * int * (int * int) * int []
checkCanMaxunpool3d shape indicesDtype indicesShape outputSize
Full Usage:
checkCanMaxunpool3d shape indicesDtype indicesShape outputSize Parameter Types:
  • shape : Shape
  • indicesDtype : Dtype
  • indicesShape : Shape
  • outputSize : int []

Return Type: int * int * (int * int * int) * int []
Signature: shape: Shape -> indicesDtype: Dtype -> indicesShape: Shape -> outputSize: int [] -> int * int * (int * int * int) * int []
Parameter Types:
  • shape : Shape
  • indicesDtype : Dtype
  • indicesShape : Shape
  • outputSize : int []
Return Type: int * int * (int * int * int) * int []
checkCanPad shape paddings
Full Usage:
checkCanPad shape paddings Parameter Types:
  • shape : Shape
  • paddings : int []

Signature: shape: Shape -> paddings: int [] -> unit
Parameter Types:
  • shape : Shape
  • paddings : int []
checkCanRepeat shape dim
Full Usage:
checkCanRepeat shape dim Parameter Types:
  • shape : Shape
  • dim : int

Signature: shape: Shape -> dim: int -> unit
Parameter Types:
  • shape : Shape
  • dim : int
checkCanSplit shape sizes dim
Full Usage:
checkCanSplit shape sizes dim Parameter Types:
  • shape : Shape
  • sizes : int []
  • dim : int

Return Type: int [] []
Signature: shape: Shape -> sizes: int [] -> dim: int -> int [] []
Parameter Types:
  • shape : Shape
  • sizes : int []
  • dim : int
Return Type: int [] []
checkCanStack shapes dim
Full Usage:
checkCanStack shapes dim Parameter Types:
  • shapes : Shape []
  • dim : int

Return Type: int * int [] * int [] * int []
Signature: shapes: Shape [] -> dim: int -> int * int [] * int [] * int []
Parameter Types:
  • shapes : Shape []
  • dim : int
Return Type: int * int [] * int [] * int []
checkCanTranspose shape dim0 dim1
Full Usage:
checkCanTranspose shape dim0 dim1 Parameter Types:
  • shape : Shape
  • dim0 : int
  • dim1 : int

Signature: shape: Shape -> dim0: int -> dim1: int -> unit
Parameter Types:
  • shape : Shape
  • dim0 : int
  • dim1 : int
checkCanTranspose2d dim
Full Usage:
checkCanTranspose2d dim Parameter Types:
  • dim : int

Signature: dim: int -> unit
Parameter Types:
  • dim : int
checkCanUnsqueeze dim shape
Full Usage:
checkCanUnsqueeze dim shape Parameter Types:
  • dim : int
  • shape : Shape

Return Type: int []
Signature: dim: int -> shape: Shape -> int []
Parameter Types:
  • dim : int
  • shape : Shape
Return Type: int []
checkCanUnstack shape dim
Full Usage:
checkCanUnstack shape dim Parameter Types:
  • shape : Shape
  • dim : int

Return Type: int [] * int [] * int []
Signature: shape: Shape -> dim: int -> int [] * int [] * int []
Parameter Types:
  • shape : Shape
  • dim : int
Return Type: int [] * int [] * int []
checkCanView shape1 shape2
Full Usage:
checkCanView shape1 shape2 Parameter Types:
  • shape1 : Shape
  • shape2 : Shape

Signature: shape1: Shape -> shape2: Shape -> unit
Parameter Types:
  • shape1 : Shape
  • shape2 : Shape
complete nelement shape
Full Usage:
complete nelement shape Parameter Types:
  • nelement : int
  • shape : Shape

Return Type: Shape
Signature: nelement: int -> shape: Shape -> Shape
Parameter Types:
  • nelement : int
  • shape : Shape
Return Type: Shape
completeDim dims dim
Full Usage:
completeDim dims dim Parameter Types:
  • dims : int
  • dim : int

Return Type: int
Signature: dims: int -> dim: int -> int
Parameter Types:
  • dims : int
  • dim : int
Return Type: int
computeTranspose2d shape
Full Usage:
computeTranspose2d shape Parameter Types:
  • shape : Shape

Return Type: int []
Signature: shape: Shape -> int []
Parameter Types:
  • shape : Shape
Return Type: int []
contains bigShape smallShape
Full Usage:
contains bigShape smallShape Parameter Types:
  • bigShape : Shape
  • smallShape : Shape

Return Type: bool
Signature: bigShape: Shape -> smallShape: Shape -> bool
Parameter Types:
  • bigShape : Shape
  • smallShape : Shape
Return Type: bool
dilated shape dilations
Full Usage:
dilated shape dilations Parameter Types:
  • shape : Shape
  • dilations : int []

Return Type: int []
Signature: shape: Shape -> dilations: int [] -> int []
Parameter Types:
  • shape : Shape
  • dilations : int []
Return Type: int []
dilated2 shape dilations
Full Usage:
dilated2 shape dilations Parameter Types:
  • shape : Shape
  • dilations : int []

Return Type: int []
Signature: shape: Shape -> dilations: int [] -> int []
Parameter Types:
  • shape : Shape
  • dilations : int []
Return Type: int []
flatten startDim endDim shape
Full Usage:
flatten startDim endDim shape Parameter Types:
  • startDim : int
  • endDim : int
  • shape : Shape

Return Type: int []
Signature: startDim: int -> endDim: int -> shape: Shape -> int []
Parameter Types:
  • startDim : int
  • endDim : int
  • shape : Shape
Return Type: int []
locationToBounds shape location
Full Usage:
locationToBounds shape location Parameter Types:
  • shape : Shape
  • location : int []

Return Type: int [,]
Signature: shape: Shape -> location: int [] -> int [,]
Parameter Types:
  • shape : Shape
  • location : int []
Return Type: int [,]
scalar
Full Usage:
scalar
Return Type: Shape
Signature: Shape
Return Type: Shape
squeeze dim shape
Full Usage:
squeeze dim shape Parameter Types:
  • dim : int
  • shape : Shape

Return Type: int []
Signature: dim: int -> shape: Shape -> int []
Parameter Types:
  • dim : int
  • shape : Shape
Return Type: int []
undilatedShape shape dilations
Full Usage:
undilatedShape shape dilations Parameter Types:
  • shape : Shape
  • dilations : int []

Return Type: int []
Signature: shape: Shape -> dilations: int [] -> int []
Parameter Types:
  • shape : Shape
  • dilations : int []
Return Type: int []
unsqueezeAs shape1 shape2
Full Usage:
unsqueezeAs shape1 shape2 Parameter Types:
  • shape1 : Shape
  • shape2 : Shape

Return Type: int []
Signature: shape1: Shape -> shape2: Shape -> int []
Parameter Types:
  • shape1 : Shape
  • shape2 : Shape
Return Type: int []