<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/BNNSTensor",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "c:@SA@BNNSTensor"
  },
  "title" : "BNNSTensor"
}
-->

# BNNSTensor

A structure that describes the shape, stride, data type, and, optionally, the memory location of an n-dimensional array.

```
struct BNNSTensor
```

## Topics

### Initializers

[`init()`](/documentation/Accelerate/BNNSTensor/init())

Creates an empty tensor.

[`init(data_type:rank:shape:stride:data:data_size_in_bytes:name:)`](/documentation/Accelerate/BNNSTensor/init(data_type:rank:shape:stride:data:data_size_in_bytes:name:))

Creates a tensor with the specified properties.

### Specifying a tensor’s properties

[`data_type`](/documentation/Accelerate/BNNSTensor/data_type)

The data type of the tensor.

[`rank`](/documentation/Accelerate/BNNSTensor/rank)

The rank of the tensor.

[`shape`](/documentation/Accelerate/BNNSTensor/shape)

A tuple of unsigned-integer elements that specify the size of the tensor.

[`stride`](/documentation/Accelerate/BNNSTensor/stride)

A tuple of unsigned-integer elements that specify the stride of the tensor.

[`data`](/documentation/Accelerate/BNNSTensor/data)

A pointer to the memory that contains the tensor values.

[`data_size_in_bytes`](/documentation/Accelerate/BNNSTensor/data_size_in_bytes)

The size, in bytes, of the memory that contains the tensor values.

[`name`](/documentation/Accelerate/BNNSTensor/name)

An optional name for the tensor that you can use for debugging.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)