Skip to content
This repository has been archived by the owner on Oct 17, 2022. It is now read-only.

Commit

Permalink
reopened dev
Browse files Browse the repository at this point in the history
  • Loading branch information
abtExp committed Nov 4, 2017
1 parent 94100da commit 4d27822
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/arrange.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
* ? @elems_arr : [number] : The elements to be arranged
* Returns : [number] : Array of the provided shape filled with the passed elements or random elements
*/
module.exports = function arrange(shape, elems_arr) {
module.exports = function arrange(shape, elems_arr, dtype = 'float32') {
const { form_chunks, flatten } = require('./core');
let base_arr = flatten(elems_arr),
curr_arr = [];
for (let i = shape.length - 1; i > 0; i--) {
let size = shape[i],
no = i > 1 ? shape[i - 1] * shape[i - 2] : shape[i - 1];
curr_arr = form_chunks(size, no, base_arr);
curr_arr = form_chunks(size, no, base_arr, dtype);
base_arr = curr_arr;
}
return base_arr;
Expand Down

0 comments on commit 4d27822

Please sign in to comment.