Hello everyone!

I am currently trying to represent PyTorch’s var_mean and getitem operators using MLIR Dialect, but I am facing some difficulties and would appreciate your guidance.

Specifically, the `var_mean`

operator calculates the variance and mean of a tensor along a specified dimension, and then returns a tuple containing these two results. It’s important to note that the variance and mean returned by `var_mean`

are also tensors. The `getitem`

operator, on the other hand, retrieves a value from a tuple, tensor, etc., based on an index value. In my actual project scenario, `getitem`

is used to retrieve a value from the result returned by the `var_mean`

operator. It either retrieves the variance or the mean.

My confusion lies in how to represent these two operators with MLIR Dialect. I noticed that there is `TupleType`

in MLIR, but I couldn’t find how to retrieve a value from a `TupleType`

.

Any guidance or suggestions would be greatly appreciated. Thank you in advance for your help!