mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-22 06:11:27 +08:00
expose observers to python
Summary: observer framework can now be used in python + a small writeup of how to use it Reviewed By: salexspb Differential Revision: D5905002 fbshipit-source-id: e40ec24a55e08fb73beea9b4f3b68e71fc66ffb1
This commit is contained in:
committed by
Facebook Github Bot
parent
f11ff5befb
commit
63caca89db
@ -1878,6 +1878,13 @@ class Net(object):
|
||||
* [ScopedBlobReference(b) for b in outputs]
|
||||
)
|
||||
|
||||
def AddObserver(self, observer):
|
||||
return C.add_observer_to_net(self._net.name, observer)
|
||||
|
||||
# This will return any observer added to the net.
|
||||
def GetObserver(self, index):
|
||||
return C.get_observer_from_net(self._net.name, index)
|
||||
|
||||
@property
|
||||
def external_inputs(self):
|
||||
return [_get_blob_ref(x) for x in self._net.external_input]
|
||||
|
Reference in New Issue
Block a user