Git Product home page Git Product logo

Comments (5)

kashif avatar kashif commented on June 2, 2024 1

sorry for the late reply... I fixed it in agentnet/utils/shared.py via:

diff --git a/agentnet/utils/shared.py b/agentnet/utils/shared.py
index 3153378..06e5991 100644
--- a/agentnet/utils/shared.py
+++ b/agentnet/utils/shared.py
@@ -10,14 +10,11 @@ import theano.tensor as T
 def create_shared(name, initial_value, dtype='floatX', strict=False, allow_downcast=True,device=None):
     if dtype == "floatX":
         dtype = theano.config.floatX
-    initial_value = np.array(initial_value, dtype=dtype)
-    if device is not None:
-        variable = theano.tensor._shared(initial_value, name=name, strict=strict, allow_downcast=allow_downcast,target=device)
-    else:
-        variable = theano.shared(initial_value, name=name, strict=strict, allow_downcast=allow_downcast)
+    initial_value = np.ascontiguousarray(initial_value, dtype=dtype)
+    variable = theano.shared(initial_value, name=name, strict=strict, allow_downcast=allow_downcast)
     return variable


 def set_shared(var, value):
-    val_array = np.array(value, dtype=var.dtype)
+    val_array = np.ascontiguousarray(value, dtype=var.dtype)
     var.set_value(val_array)

will send a PR soon.

from agentnet.

justheuristic avatar justheuristic commented on June 2, 2024

Hello and sorry for the delay.
Could you please specify in which condition did it occur? (a small code snippet would be ideal).
As a temporary solution, try switching from GpuArray into CUDA backend.

from agentnet.

justheuristic avatar justheuristic commented on June 2, 2024

Wow, thanks! Would happily accept that.

from agentnet.

justheuristic avatar justheuristic commented on June 2, 2024

@kashif Hello again!
Not that we're in a hurry, but if you don't mind i'd commit that on your behalf (with references in comments).

from agentnet.

kashif avatar kashif commented on June 2, 2024

thanks! So sorry for the delay.. I checked again my stuff and did not get any problems... so I am now confused if this helped or not...

from agentnet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.