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

# init(data:shape:stride:dataType:)

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

## Declaration

```swift
init(data: UnsafeMutableRawBufferPointer, shape: [Int], stride: [Int], dataType: BNNSDataType)
```

## Parameters

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