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

# init(initializingFrom:shape:stride:)

Returns a BNNSTensor structure that’s initialized with every element of the source.

## Declaration

```swift
init<T>(initializingFrom source: some AccelerateBuffer, shape: [Int], stride: [Int]) where T : BNNSScalar
```

## Parameters

- `source`: A collection of elements that the function uses to initialize the tensor’s storage.
- `shape`: The shape of the tensor.
- `stride`: The stride of the tensor.
