Attend the Women in ML Symposium on December 7

# VectorProtocol

Stay organized with collections Save and categorize content based on your preferences.
``public protocol VectorProtocol : AdditiveArithmetic``

A type that represents an unranked vector space. Values of this type are elements in this vector space and have either no shape or a static shape.

• ``` VectorSpaceScalar ```

The type of scalars in the vector space.

#### Declaration

``associatedtype VectorSpaceScalar : AdditiveArithmetic``
• ``` adding(_:) ```

#### Declaration

``func adding(_ x: VectorSpaceScalar) -> Self``
• ``` add(_:) ``` Default implementation

#### Declaration

``mutating mutating func add(_ x: VectorSpaceScalar)``
• ``` subtracting(_:) ```

#### Declaration

``func subtracting(_ x: VectorSpaceScalar) -> Self``
• ``` subtract(_:) ``` Default implementation

#### Declaration

``mutating mutating func subtract(_ x: VectorSpaceScalar)``
• ``` scaled(by:) ```

Returns `self` multiplied by the given scalar.

#### Declaration

``func scaled(by scalar: VectorSpaceScalar) -> Self``
• ``` scale(by:) ``` Default implementation

Multiplies `self` by the given scalar.

#### Declaration

``mutating mutating func scale(by scalar: VectorSpaceScalar)``
[{ "type": "thumb-down", "id": "missingTheInformationINeed", "label":"Missing the information I need" },{ "type": "thumb-down", "id": "tooComplicatedTooManySteps", "label":"Too complicated / too many steps" },{ "type": "thumb-down", "id": "outOfDate", "label":"Out of date" },{ "type": "thumb-down", "id": "samplesCodeIssue", "label":"Samples / code issue" },{ "type": "thumb-down", "id": "otherDown", "label":"Other" }]
[{ "type": "thumb-up", "id": "easyToUnderstand", "label":"Easy to understand" },{ "type": "thumb-up", "id": "solvedMyProblem", "label":"Solved my problem" },{ "type": "thumb-up", "id": "otherUp", "label":"Other" }]