<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 11.0.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MetalPerformanceShadersGraph",
  "identifier" : "/documentation/MetalPerformanceShadersGraph/MPSGraph/randomPhiloxStateTensor(withCounterLow:counterHigh:key:name:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Metal Performance Shaders Graph",
      "MetalPerformanceShadersGraph"
    ],
    "preciseIdentifier" : "c:objc(cs)MPSGraph(im)randomPhiloxStateTensorWithCounterLow:counterHigh:key:name:"
  },
  "title" : "randomPhiloxStateTensor(withCounterLow:counterHigh:key:name:)"
}
-->

# randomPhiloxStateTensor(withCounterLow:counterHigh:key:name:)

Creates a tensor representing state using the Philox algorithm with given counter and key values.

```
func randomPhiloxStateTensor(withCounterLow counterLow: Int, counterHigh: Int, key: Int, name: String?) -> MPSGraphTensor
```

## Parameters

`counterLow`

The value to initilaize lower 64 bits of counter to. Philox utilizes a 128 bit counter

`counterHigh`

The value to initilaize upper 64 bits of counter to. Philox utilizes a 128 bit counter

`key`

The value to initialize the key to in Philox algorithm.

`name`

Name for the operation

## Return Value

An MPSGraphTensor representing a random state, to be passed as an input to a random op.

## Discussion

See randomPhiloxStateTensorWithSeed.

---

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)