Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minimal changes for Python2+3 compatibility #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ctn_benchmark/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def __init__(self):
def default(self, description, **kwarg):
if len(kwarg) != 1:
raise ValueException('Must specify exactly one parameter')
k, v = kwarg.items()[0]
k, v = list(kwarg.items())[0]
if k in self.param_names:
raise ValueException('Cannot redefine parameter "%s"' % k)
if v is False:
Expand Down
4 changes: 2 additions & 2 deletions ctn_benchmark/spa/memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

import ctn_benchmark

import split
from . import split

class SemanticMemory(ctn_benchmark.Benchmark):
def params(self):
Expand Down Expand Up @@ -66,7 +66,7 @@ def marker(t):
for node in model.all_nodes:
if node.output is None:
if node.size_in > p.pf_max_dim:
print 'limiting', node
print('limiting', node)
model.config[node].n_cores_per_chip = p.pf_cores
model.config[node].n_chips = p.pf_n_chips
model.config[
Expand Down
4 changes: 2 additions & 2 deletions ctn_benchmark/spa/memory_recall.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

import ctn_benchmark

import split
from . import split

class SemanticMemory(ctn_benchmark.Benchmark):
def params(self):
Expand Down Expand Up @@ -81,7 +81,7 @@ def cue(t):
for node in model.all_nodes:
if node.output is None:
if node.size_in > p.pf_max_dim:
print 'limiting', node
print('limiting', node)
model.config[node].n_cores_per_chip = p.pf_cores
model.config[node].n_chips = p.pf_n_chips
model.config[
Expand Down
4 changes: 2 additions & 2 deletions ctn_benchmark/spa/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

import ctn_benchmark

import split
from . import split

class Parsing(ctn_benchmark.Benchmark):
def params(self):
Expand Down Expand Up @@ -68,7 +68,7 @@ def vision_input(t):
for node in model.all_nodes:
if node.output is None:
if node.size_in > p.pf_max_dim:
print 'limiting', node
print('limiting', node)
model.config[node].n_cores_per_chip = p.pf_cores
model.config[node].n_chips = p.pf_n_chips
model.config[
Expand Down
4 changes: 2 additions & 2 deletions ctn_benchmark/spa/sequence_routed.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
basal ganglia and thalamus.
"""

import split
from . import split


import ctn_benchmark
Expand Down Expand Up @@ -56,7 +56,7 @@ def model(self, p):
for node in model.all_nodes:
if node.output is None:
if node.size_in > p.pf_max_dim:
print 'limiting', node
print('limiting', node)
model.config[node].n_cores_per_chip = p.pf_cores
model.config[node].n_chips = p.pf_n_chips

Expand Down
3 changes: 2 additions & 1 deletion ctn_benchmark/spa/split.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import numpy as np
import nengo
from six import iteritems

def gather_info(network, inputs, outputs, parents):
for c in network.connections:
Expand Down Expand Up @@ -183,7 +184,7 @@ def pass_ensembles(model, max_dim=16):
total_out[key] += c.size_out
conns[key].append(c)

for key, total in total_out.items():
for key, total in iteritems(total_out):
if total > max_dim:
f, slice = key
cs = conns[key]
Expand Down