legate.core.Machine.__getitem__#

Machine.__getitem__()#

Slices the machine with a given slicer

Parameters:

key (TaskTarget, slice, int, tuple[TaskTarget, slice]) –

Key to slice the machine by

If the key is a TaskTarget, a machine with only the processors of the chosen kind is returned.

If the key is a slice, the returned machine only has a processor range for the preferred target, which is sliced by the key. An integer key is treated like a singleton slice (i.e., slice(key, key + 1)).

If the key is a pair of a task target and a slice, the returned machine only has a processor range of the chosen kind, which is sliced by the key.

Returns:

A new machine after slicing

Return type:

Machine