@frozen
public extension Array where Element: Differentiable
  • Declaration

    @differentiable
    func differentiableReduce<Result: Differentiable>(
      _ initialResult: Result,
      _ nextPartialResult: @differentiable (Result, Element) -> Result
    ) -> Result
  • Declaration

    public typealias AllKeyPaths = [PartialKeyPath<Array>]
  • Declaration

    public var allKeyPaths: [PartialKeyPath<Array>] { get }
  • Creates an Array with the same shape and scalars as the specified numpy.ndarray instance.

    Precondition

    The numpy Python package must be installed.

    Declaration

    public init?(numpy numpyArray: PythonObject)

    Parameters

    numpyArray

    The numpy.ndarray instance to convert.

    Return Value

    numpyArray converted to an Array. Returns nil if numpyArray is not 1-D or does not have a compatible scalar dtype.

  • Creates a 1-D numpy.ndarray instance with the same scalars as this Array.

    Precondition

    The numpy Python package must be installed.

    Declaration

    func makeNumpyArray() -> PythonObject
  • The square root of x.

    For real types, if x is negative the result is .nan. For complex types there is a branch cut on the negative real axis.

    Declaration

    public static func sqrt(_ x: `Self`) -> Array<Element>
  • The cosine of x, interpreted as an angle in radians.

    Declaration

    public static func cos(_ x: `Self`) -> Array<Element>
  • The sine of x, interpreted as an angle in radians.

    Declaration

    public static func sin(_ x: `Self`) -> Array<Element>
  • The tangent of x, interpreted as an angle in radians.

    Declaration

    public static func tan(_ x: `Self`) -> Array<Element>
  • The inverse cosine of x in radians.

    Declaration

    public static func acos(_ x: `Self`) -> Array<Element>
  • The inverse sine of x in radians.

    Declaration

    public static func asin(_ x: `Self`) -> Array<Element>
  • The inverse tangent of x in radians.

    Declaration

    public static func atan(_ x: `Self`) -> Array<Element>
  • The hyperbolic cosine of x.

    Declaration

    public static func cosh(_ x: `Self`) -> Array<Element>
  • The hyperbolic sine of x.

    Declaration

    public static func sinh(_ x: `Self`) -> Array<Element>
  • The hyperbolic tangent of x.

    Declaration

    public static func tanh(_ x: `Self`) -> Array<Element>
  • The inverse hyperbolic cosine of x.

    Declaration

    public static func acosh(_ x: `Self`) -> Array<Element>
  • The inverse hyperbolic sine of x.

    Declaration

    public static func asinh(_ x: `Self`) -> Array<Element>
  • The inverse hyperbolic tangent of x.

    Declaration

    public static func atanh(_ x: `Self`) -> Array<Element>
  • The exponential function applied to x, or e**x.

    Declaration

    public static func exp(_ x: `Self`) -> Array<Element>
  • Two raised to to power x.

    Declaration

    public static func exp2(_ x: `Self`) -> Array<Element>
  • Ten raised to to power x.

    Declaration

    public static func exp10(_ x: `Self`) -> Array<Element>
  • exp(x) - 1 evaluated so as to preserve accuracy close to zero.

    Declaration

    public static func expm1(_ x: `Self`) -> Array<Element>
  • The natural logarithm of x.

    Declaration

    public static func log(_ x: `Self`) -> Array<Element>
  • The base-two logarithm of x.

    Declaration

    public static func log2(_ x: `Self`) -> Array<Element>
  • The base-ten logarithm of x.

    Declaration

    public static func log10(_ x: `Self`) -> Array<Element>
  • log(1 + x) evaluated so as to preserve accuracy close to zero.

    Declaration

    public static func log1p(_ x: `Self`) -> Array<Element>
  • exp(y log(x)) computed without loss of intermediate precision.

    For real types, if x is negative the result is NaN, even if y has an integral value. For complex types, there is a branch cut on the negative real axis.

    Declaration

    public static func pow(_ x: `Self`, _ y: `Self`) -> Array<Element>
  • x raised to the nth power.

    The product of n copies of x.

    Declaration

    public static func pow(_ x: `Self`, _ n: Int) -> Array<Element>
  • The nth root of x.

    For real types, if x is negative and n is even, the result is NaN. For complex types, there is a branch cut along the negative real axis.

    Declaration

    public static func root(_ x: `Self`, _ n: Int) -> Array<Element>