MCPcopy Create free account
hub / github.com/BindsNET/bindsnet / clone

Method clone

bindsnet/network/network.py:199–209  ·  view source on GitHub ↗

Returns a cloned network object. :return: A copy of this network.

(self)

Source from the content-addressed store, hash-verified

197 torch.save(self, open(file_name, "wb"))
198
199 def clone(self) -> "Network":
200 # language=rst
201 """
202 Returns a cloned network object.
203
204 :return: A copy of this network.
205 """
206 virtual_file = tempfile.SpooledTemporaryFile()
207 torch.save(self, virtual_file)
208 virtual_file.seek(0)
209 return torch.load(virtual_file)
210
211 def _get_inputs(self, layers: Iterable = None) -> Dict[str, torch.Tensor]:
212 # language=rst

Callers 14

_florian_mstdpFunction · 0.80
_florian_mstdpetFunction · 0.80
_driveFunction · 0.80
_drive_shapedFunction · 0.80
__init__Method · 0.80
reset_state_variablesMethod · 0.80
__init__Method · 0.80
reset_state_variablesMethod · 0.80
plot_inputFunction · 0.80
plot_spikesFunction · 0.80
plot_weightsFunction · 0.80
plot_assignmentsFunction · 0.80

Calls 1

saveMethod · 0.45

Tested by 4

_florian_mstdpFunction · 0.64
_florian_mstdpetFunction · 0.64
_driveFunction · 0.64
_drive_shapedFunction · 0.64