[BE][MPS] Add `dictionaryFromPlaceholders` (#119077)
Which are a convenience methods that create a dictionary from placeholder, making code a more compact.
Also added `runMPSGraph` overloaded function with Placeholder instead of an output dictionary, as majority of the operators have just one output.
Typical change looks as follows
```patch
- NSDictionary<MPSGraphTensor*, MPSGraphTensorData*>* feeds = @{
- selfPlaceholder.getMPSGraphTensor() : selfPlaceholder.getMPSGraphTensorData(),
- };
- NSDictionary<MPSGraphTensor*, MPSGraphTensorData*>* results =
- @{outputPlaceholder.getMPSGraphTensor() : outputPlaceholder.getMPSGraphTensorData()};
- runMPSGraph(stream, cachedGraph->graph(), feeds, results);
+ auto feeds = dictionaryFromPlaceholders(selfPlaceholder);
+ runMPSGraph(stream, cachedGraph->graph(), feeds, outputPlaceholder);
}
```
Pull Request resolved: https://github.com/pytorch/pytorch/pull/119077
Approved by: https://github.com/kit1980, https://github.com/albanD