---
title: "init(data:shape:stride:)"
framework: accelerate
role: symbol
role_heading: Initializer
path: "accelerate/bnnstensor/init(data:shape:stride:)"
---

# init(data:shape:stride:)

Creates a BNNSTensor that references the same memory as the specified UnsafeMutableBufferPointer.

## Declaration

```swift
init<T>(data: UnsafeMutableBufferPointer<T>, shape: [Int], stride: [Int]) where T : BNNSScalar
```

## Parameters

- `data`: A pointer to the source data.
- `shape`: The shape of the tensor.
- `stride`: The stride of the tensor.
