You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
shape=copy(shape);// perform a copy to avoid unintended mutation
96
98
N=shape.length;
99
+
97
100
sh=getShape(arr,false);
98
101
M=sh.length;
99
102
if(N<M){
100
103
thrownewError('invalid argument. Cannot broadcast an array to a shape having fewer dimensions. Arrays can only be broadcasted to shapes having the same or more dimensions.');
101
104
}
102
-
// Initialize a strides array...
103
-
strides=[];
104
-
for(i=0;i<N;i++){
105
-
strides.push(0);
106
-
}
107
-
// Determine the output array strides...
108
-
st=getStrides(arr,false);
105
+
// Initialize a strides array:
106
+
strides=zeros(N);
109
107
110
-
if(!dims){
111
-
dims=[-1];
112
-
}
113
108
// Verify that we've been provided a list of unique dimension indices...
114
109
dl=dims.length;
115
-
dims=normalizeIndices(dims,N-1);
110
+
dims=normalizeIndices(dims,N-1);
116
111
if(dims===null){
117
112
thrownewRangeError(format('invalid argument. Third argument contains an out-of-bounds dimension index. Value: [%s].',join(dims,',')));
0 commit comments