Skip to content

Commit

Permalink
fixed small bug in Crossbar.py
Browse files Browse the repository at this point in the history
The code would have called memtorch_cuda_bindings even if the version was CPU.
  • Loading branch information
Philippe-Drolet committed Feb 7, 2022
1 parent 34a7862 commit de8dc2d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions memtorch/bh/crossbar/Crossbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,13 +242,17 @@ def write_conductance_matrix(
if (
self.use_bindings
and type(self.devices.any()) in CUDA_passive_implemented
and "cpu" not in memtorch.__version__
):
device_matrix = build_g_tensor(self)
device_matrix_aug = device_matrix
conductance_matrix_aug = conductance_matrix
if (
len(device_matrix.shape) == 2
): # To ensure compatibility with CUDA code
device_matrix_aug = device_matrix[:, :, None]
conductance_matrix_aug = conductance_matrix[:, :, None]

new_matrix = memtorch_cuda_bindings.simulate_passive(
conductance_matrix_aug,
device_matrix_aug,
Expand Down

0 comments on commit de8dc2d

Please sign in to comment.