---
title: "init(bytesNoCopy: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(bytesnocopy:length:)"
---

# init(bytesNoCopy:length:)

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

## Declaration

```swift
convenience init(bytesNoCopy bytes: UnsafeMutableRawPointer, length: Int)
```

## Parameters

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

## See Also

### Creating Tensor Data

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