@classmethod<EOL><INDENT>@contextlib.contextmanager<EOL>def use_device(cls, device):<DEDENT>
if device == cls.ops.device:<EOL><INDENT>yield<EOL><DEDENT>else:<EOL><INDENT>curr_Ops, curr_ops = (cls.Ops, cls.ops)<EOL>cls.Ops = get_ops(device)<EOL>cls.ops = cls.Ops()<EOL>yield<EOL>cls.Ops = curr_Ops<EOL>cls.ops = curr_ops<EOL><DEDENT>
Change the device to execute on for the scope of the block.