StreamContext¶ class torch.cpu.StreamContext(stream)[源代码][源代码]¶ 选择给定 stream 的上下文管理器。 注意:此类仅用于方便编写与设备无关的代码