---
title: BNNSTensor
framework: accelerate
role: symbol
role_heading: Structure
path: accelerate/bnnstensor
---

# BNNSTensor

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

## Declaration

```swift
struct BNNSTensor
```

## Topics

### Initializers

- [init()](accelerate/bnnstensor/init().md)
- [init(data_type:rank:shape:stride:data:data_size_in_bytes:name:)](accelerate/bnnstensor/init(data_type:rank:shape:stride:data:data_size_in_bytes:name:).md)
- [init(data:shape:stride:)](accelerate/bnnstensor/init(data:shape:stride:).md)
- [init(data:shape:stride:dataType:)](accelerate/bnnstensor/init(data:shape:stride:datatype:).md)
- [init(dataType:shape:stride:)](accelerate/bnnstensor/init(datatype:shape:stride:).md)
- [init(initializingFrom:shape:stride:)](accelerate/bnnstensor/init(initializingfrom:shape:stride:).md)
- [init(shape:stride:dataType:)](accelerate/bnnstensor/init(shape:stride:datatype:).md)

### Specifying a tensor’s properties

- [data_type](accelerate/bnnstensor/data_type.md)
- [rank](accelerate/bnnstensor/rank.md)
- [shape](accelerate/bnnstensor/shape.md)
- [stride](accelerate/bnnstensor/stride.md)
- [data](accelerate/bnnstensor/data.md)
- [data_size_in_bytes](accelerate/bnnstensor/data_size_in_bytes.md)
- [name](accelerate/bnnstensor/name.md)

### Instance Properties

- [count](accelerate/bnnstensor/count.md)

### Instance Methods

- [allocate(as:count:)](accelerate/bnnstensor/allocate(as:count:).md)
- [allocate(initializingFrom:)](accelerate/bnnstensor/allocate(initializingfrom:).md)
- [deallocate()](accelerate/bnnstensor/deallocate().md)
- [makeArray(of:)](accelerate/bnnstensor/makearray(of:).md)

### Type Methods

- [allocate(initializingFrom:shape:stride:)](accelerate/bnnstensor/allocate(initializingfrom:shape:stride:).md)
- [allocate(repeating:shape:stride:)](accelerate/bnnstensor/allocate(repeating:shape:stride:).md)
- [allocateUninitialized(scalarType:shape:stride:)](accelerate/bnnstensor/allocateuninitialized(scalartype:shape:stride:).md)

## Relationships

### Conforms To

- [BitwiseCopyable](swift/bitwisecopyable.md)

## See Also

### Specifying and querying a tensor’s properties

- [BNNSTensorGetAllocationSize(_:)](accelerate/bnnstensorgetallocationsize(_:).md)
- [BNNSGraphContextGetTensor(_:_:_:_:_:)](accelerate/bnnsgraphcontextgettensor(_:_:_:_:_:).md)
- [BNNSGraphTensorFillStrides(_:_:_:_:)](accelerate/bnnsgraphtensorfillstrides(_:_:_:_:).md)
