---
title: MPSGraphTensorData
framework: metalperformanceshadersgraph
role: symbol
role_heading: Class
path: metalperformanceshadersgraph/mpsgraphtensordata
---

# MPSGraphTensorData

The representation of a compute data type.

## Declaration

```swift
class MPSGraphTensorData
```

## Overview

Overview Pass data to a graph using a tensor data, a reference will be taken to your data and used just in time when the graph is run.

## Topics

### Initializers

- [init(MPSImageBatch:)](metalperformanceshadersgraph/mpsgraphtensordata/init(mpsimagebatch:).md)
- [init(MPSMatrix:)](metalperformanceshadersgraph/mpsgraphtensordata/init(mpsmatrix:).md)
- [init(MPSMatrix:rank:)](metalperformanceshadersgraph/mpsgraphtensordata/init(mpsmatrix:rank:).md)
- [init(MPSNDArray:)](metalperformanceshadersgraph/mpsgraphtensordata/init(mpsndarray:).md)
- [init(MPSVector:)](metalperformanceshadersgraph/mpsgraphtensordata/init(mpsvector:).md)
- [init(MPSVector:rank:)](metalperformanceshadersgraph/mpsgraphtensordata/init(mpsvector:rank:).md)
- [init(MTLBuffer:shape:dataType:)](metalperformanceshadersgraph/mpsgraphtensordata/init(mtlbuffer:shape:datatype:).md)
- [init(MTLBuffer:shape:dataType:rowBytes:)](metalperformanceshadersgraph/mpsgraphtensordata/init(mtlbuffer:shape:datatype:rowbytes:).md)
- [init(MTLTensor:)](metalperformanceshadersgraph/mpsgraphtensordata/init(mtltensor:).md)
- [init(_:)](metalperformanceshadersgraph/mpsgraphtensordata/init(_:)-2go2.md)
- [init(_:)](metalperformanceshadersgraph/mpsgraphtensordata/init(_:)-4bnfb.md)
- [init(_:)](metalperformanceshadersgraph/mpsgraphtensordata/init(_:)-511a.md)
- [init(_:)](metalperformanceshadersgraph/mpsgraphtensordata/init(_:)-60j6x.md)
- [init(_:)](metalperformanceshadersgraph/mpsgraphtensordata/init(_:)-9kgoe.md)
- [init(_:rank:)](metalperformanceshadersgraph/mpsgraphtensordata/init(_:rank:)-1e4ks.md)
- [init(_:rank:)](metalperformanceshadersgraph/mpsgraphtensordata/init(_:rank:)-1lnxg.md)
- [init(_:shape:dataType:)](metalperformanceshadersgraph/mpsgraphtensordata/init(_:shape:datatype:).md)
- [init(_:shape:dataType:rowBytes:)](metalperformanceshadersgraph/mpsgraphtensordata/init(_:shape:datatype:rowbytes:).md)
- [init(device:data:shape:dataType:)](metalperformanceshadersgraph/mpsgraphtensordata/init(device:data:shape:datatype:).md)

### Instance Properties

- [dataType](metalperformanceshadersgraph/mpsgraphtensordata/datatype.md)
- [device](metalperformanceshadersgraph/mpsgraphtensordata/device.md)
- [shape](metalperformanceshadersgraph/mpsgraphtensordata/shape.md)

### Instance Methods

- [mpsndarray()](metalperformanceshadersgraph/mpsgraphtensordata/mpsndarray().md)

## Relationships

### Inherits From

- [MPSGraphObject](metalperformanceshadersgraph/mpsgraphobject.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Classes

- [MPSGraph](metalperformanceshadersgraph/mpsgraph.md)
- [MPSGraphCompilationDescriptor](metalperformanceshadersgraph/mpsgraphcompilationdescriptor.md)
- [MPSGraphConvolution2DOpDescriptor](metalperformanceshadersgraph/mpsgraphconvolution2dopdescriptor.md)
- [MPSGraphConvolution3DOpDescriptor](metalperformanceshadersgraph/mpsgraphconvolution3dopdescriptor.md)
- [MPSGraphCreateSparseOpDescriptor](metalperformanceshadersgraph/mpsgraphcreatesparseopdescriptor.md)
- [MPSGraphDepthwiseConvolution2DOpDescriptor](metalperformanceshadersgraph/mpsgraphdepthwiseconvolution2dopdescriptor.md)
- [MPSGraphDepthwiseConvolution3DOpDescriptor](metalperformanceshadersgraph/mpsgraphdepthwiseconvolution3dopdescriptor.md)
- [MPSGraphDevice](metalperformanceshadersgraph/mpsgraphdevice.md)
- [MPSGraphExecutable](metalperformanceshadersgraph/mpsgraphexecutable.md)
- [MPSGraphExecutableExecutionDescriptor](metalperformanceshadersgraph/mpsgraphexecutableexecutiondescriptor.md)
- [MPSGraphExecutableSerializationDescriptor](metalperformanceshadersgraph/mpsgraphexecutableserializationdescriptor.md)
- [MPSGraphExecutionDescriptor](metalperformanceshadersgraph/mpsgraphexecutiondescriptor.md)
- [MPSGraphFFTDescriptor](metalperformanceshadersgraph/mpsgraphfftdescriptor.md)
- [MPSGraphGRUDescriptor](metalperformanceshadersgraph/mpsgraphgrudescriptor.md)
- [MPSGraphImToColOpDescriptor](metalperformanceshadersgraph/mpsgraphimtocolopdescriptor.md)
