---
title: "init(immutableBytesNoCopy:length:)"
framework: ML Compute
role: symbol
role_heading: Initializer
platforms: [iOS 14.0+, iPadOS 14.0+, Mac Catalyst 14.0+, macOS 11.0+, tvOS 14.0+]
path: "mlcompute/mlctensordata/init(immutablebytesnocopy:length:)"
---

# init(immutableBytesNoCopy:length:)

Creates a tensor data instance with the buffer of immutable data and length of bytes you specify.

## Declaration

```swift
convenience init(immutableBytesNoCopy bytes: UnsafeRawPointer, length: Int)
```

## Parameters

- `bytes`: A buffer that contains immutable data.
- `length`: The number of bytes you choose to reference from bytes. This number must not exceed the length of bytes.

## Discussion

Discussion important: Don’t mutate the underlying bytes in a tensor data instance you create with this initializer. Doing so may result in unexpected behavior.

## See Also

### Creating Tensor Data

- [init(bytesNoCopy:length:)](mlcompute/mlctensordata/init(bytesnocopy:length:).md)
- [init(bytesNoCopy:length:deallocator:)](mlcompute/mlctensordata/init(bytesnocopy:length:deallocator:).md)
