Skip to content

Commit

Permalink
Cast weight vector to same datatype as spikes
Browse files Browse the repository at this point in the history
Previously, attachData() did not check that the weight vector `w` was the same
datatype as the given spikes `Y`, which could cause an error when performing
model operations later. This was particularly annoying when accepting the
default value of `w`. This commit makes attachData() automatically cast `w` to
the same datatype as `Y`.
  • Loading branch information
kqshan committed Jun 20, 2019
1 parent 0cd3671 commit 6307d40
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions @MoDT/attachData.m
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ function attachData(self, Y_, t_, varargin)
assert(ismember(datatype_,{'single','double'}), self.badValueErrId, ...
'Datatype must be single- or double-precision floating point');

% Cast w to the same datatype as Y
w_ = cast(w_, datatype_);

% (2) Assign values ------------------------------------------------------------

% Clear caches
Expand Down

0 comments on commit 6307d40

Please sign in to comment.