<!--
{
  "availability" : [
    "iOS: 15.4.0 -",
    "iPadOS: 15.4.0 -",
    "macCatalyst: 15.4.0 -",
    "macOS: 12.3.0 -",
    "tvOS: 15.4.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MetalPerformanceShadersGraph",
  "identifier" : "/documentation/MetalPerformanceShadersGraph/MPSGraph/coordinate(alongAxis:withShapeTensor:name:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Metal Performance Shaders Graph",
      "MetalPerformanceShadersGraph"
    ],
    "preciseIdentifier" : "c:objc(cs)MPSGraph(im)coordinateAlongAxis:withShapeTensor:name:"
  },
  "title" : "coordinate(alongAxis:withShapeTensor:name:)"
}
-->

# coordinate(alongAxis:withShapeTensor:name:)

Creates a get-coordindate operation and returns the result tensor.

```
func coordinate(alongAxis axis: Int, withShapeTensor shapeTensor: MPSGraphTensor, name: String?) -> MPSGraphTensor
```

## Parameters

`axis`

The coordinate axis an element’s value is set to. Negative values wrap around.

`shapeTensor`

A rank-1 tensor of type `MPSDataTypeInt32` or `MPSDataTypeInt64` that defines the shape of the result tensor.

`name`

The name for the operation.

## Return Value

A valid MPSGraphTensor object.

## Discussion

See [`coordinate(alongAxis:withShape:name:)`](/documentation/MetalPerformanceShadersGraph/MPSGraph/coordinate(alongAxis:withShape:name:)).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)