流れはこんな感じです。
graph TD
A["Create Shared Object Pool"] --> B["Instantiate Threads and Share."]
B --> C["Start Interaction Thread"]
B --> D["Start Training Thread"]
B --> E["Start Main Thread"]
流れはこんな感じです。
graph TD
A["Create Shared Object Pool"] --> B["Instantiate Threads and Share."]
B --> C["Start Interaction Thread"]
B --> D["Start Training Thread"]
B --> E["Start Main Thread"]
import copy | |
import threading | |
import time | |
import torch | |
import torch.nn as nn | |
import torch.nn.functional as F | |
from torch.utils.data import DataLoader, TensorDataset | |
import torch | |
import torch.nn as nn | |
import torch.backends.mps | |
class ModuleWithDevice(nn.Module): | |
def __init__(self, *args, default_device=torch.device("cpu"), **kwargs) -> None: | |
super().__init__(*args, **kwargs) | |
# If this module has no parameters, returns this value. | |
self._default_device = default_device |
import copy | |
from typing import Any, Self | |
class Reconstructable: | |
_init_args: tuple[Any, ...] | |
_init_kwds: dict[str, Any] | |
@classmethod | |
def reconstructable_init(cls, *args: Any, **kwds: Any) -> Self: |