mirror of
https://github.com/wassname/pytorch-ts.git
synced 2026-07-13 14:14:29 +08:00
13 lines
306 B
Python
13 lines
306 B
Python
import inspect
|
|
|
|
import torch.nn as nn
|
|
|
|
|
|
def get_module_forward_input_names(module: nn.Module):
|
|
params = inspect.signature(module.forward).parameters
|
|
return list(params)
|
|
|
|
|
|
def copy_parameters(net_source: nn.Module, net_dest: nn.Module) -> None:
|
|
net_dest.load_state_dict(net_source.state_dict())
|