Skip to content

Commit

Permalink
add note on possible caching
Browse files Browse the repository at this point in the history
  • Loading branch information
evfro committed Jun 3, 2018
1 parent 7e3ce41 commit 90d3b2b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion polara/recommender/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,7 @@ def slice_recommendations(self, test_data, shape, start, stop, test_users=None):
scores = self.tensor_outer_at(1.0, v, w, slice_idx[1], slice_idx[2])
scores = np.add.reduceat(scores, np.r_[0, np.where(np.diff(slice_idx[0]))[0]+1])

wt_flat = self.flatten_scores(w.T, self.flattener)
wt_flat = self.flatten_scores(w.T, self.flattener) # TODO cache result
scores = np.tensordot(scores, wt_flat, axes=(2, 0)).dot(v.T)
return scores, slice_idx

Expand Down

0 comments on commit 90d3b2b

Please sign in to comment.