You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In [1]: from primitiv import Device, Graph, functions, devices, Shape
In [2]: dev = devices.Naive()
In [3]: Device.set_default(dev)
In [4]: g = Graph()
In [5]: Graph.set_default(g)
In [6]: node = functions.ones([2,2])
In [7]: node2 = functions.dropout(node, 0.5, True)
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
<ipython-input-7-a7a723262cfe> in <module>()
----> 1 node2 = functions.dropout(node, 0.5, True)
/home/koichi/developments/primitiv/primitiv-python/primitiv/_function.pyx in primitiv._function.functions.dropout()
RuntimeError: /home/koichi/developments/primitiv/primitiv-python/primitiv-core/primitiv/mixins.h: 121: Default object is null.
dropout internally calls random::bernoulli, which can take a Graph object, without setting a graph, so random::bernoulli tries to use the default graph. However, primitiv-python no longer use C++'s set_default (#41).
The text was updated successfully, but these errors were encountered:
Example code:
dropout
internally callsrandom::bernoulli
, which can take aGraph
object, without setting a graph, sorandom::bernoulli
tries to use the default graph. However, primitiv-python no longer use C++'sset_default
(#41).The text was updated successfully, but these errors were encountered: