# Shape

    public struct Shape : Equatable, Hashable

    extension https://developers.google.com/edge/api/tflite/swift/Structs/Tensor.html.Shape: ExpressibleByArrayLiteral

The shape of a `https://developers.google.com/edge/api/tflite/swift/Structs/Tensor.html`.
- `


  ### [rank](https://developers.google.com/edge/api/tflite/swift/Structs/Tensor/Shape#/s:19TensorFlowLiteSwift0A0V5ShapeV4rankSivp)


  ` The number of dimensions of the `https://developers.google.com/edge/api/tflite/swift/Structs/Tensor.html`.

  #### Declaration

  Swift

      public let rank: Int

- `


  ### [dimensions](https://developers.google.com/edge/api/tflite/swift/Structs/Tensor/Shape#/s:19TensorFlowLiteSwift0A0V5ShapeV10dimensionsSaySiGvp)


  ` An array of dimensions for the `https://developers.google.com/edge/api/tflite/swift/Structs/Tensor.html`.

  #### Declaration

  Swift

      public let dimensions: [Int]

- `


  ### [init(_:)](https://developers.google.com/edge/api/tflite/swift/Structs/Tensor/Shape#/s:19TensorFlowLiteSwift0A0V5ShapeVyAESaySiGcfc)


  ` Creates a new instance with the given array of dimensions.

  #### Declaration

  Swift

      public init(_ dimensions: [Int])

  #### Parameters

  |---|---|
  | ` dimensions ` | Dimensions for the `https://developers.google.com/edge/api/tflite/swift/Structs/Tensor.html`. |

- `


  ### [init(_:)](https://developers.google.com/edge/api/tflite/swift/Structs/Tensor/Shape#/s:19TensorFlowLiteSwift0A0V5ShapeVyAESid_tcfc)


  ` Creates a new instance with the given elements representing the dimensions.

  #### Declaration

  Swift

      public init(_ elements: Int...)

  #### Parameters

  |---|---|
  | ` elements ` | Dimensions for the `https://developers.google.com/edge/api/tflite/swift/Structs/Tensor.html`. |

- `


  ### [init(arrayLiteral:)](https://developers.google.com/edge/api/tflite/swift/Structs/Tensor/Shape#/s:19TensorFlowLiteSwift0A0V5ShapeV12arrayLiteralAESid_tcfc)


  ` Creates a new instance with the given array literal representing the dimensions.

  #### Declaration

  Swift

      public init(arrayLiteral: Int...)

  #### Parameters

  |---|---|
  | ` arrayLiteral ` | Dimensions for the `https://developers.google.com/edge/api/tflite/swift/Structs/Tensor.html`. |