@@ -4147,11 +4147,6 @@ def vecdot(
4147
4147
out : ndarray
4148
4148
The vector dot product of the inputs computed along the specified axes.
4149
4149
4150
- Raises
4151
- ------
4152
- ValueError
4153
- If either input is a scalar value.
4154
-
4155
4150
Notes
4156
4151
-----
4157
4152
This is similar to `dot` but with broadcasting. It computes the dot product
@@ -4161,9 +4156,6 @@ def vecdot(
4161
4156
x1 = as_tensor_variable (x1 )
4162
4157
x2 = as_tensor_variable (x2 )
4163
4158
4164
- if x1 .type .ndim == 0 or x2 .type .ndim == 0 :
4165
- raise ValueError ("vecdot operand cannot be scalar" )
4166
-
4167
4159
# Handle negative axis
4168
4160
if axis < 0 :
4169
4161
x1_axis = axis % x1 .type .ndim
@@ -4209,12 +4201,6 @@ def matvec(x1: "ArrayLike", x2: "ArrayLike", dtype: Optional["DTypeLike"] = None
4209
4201
out : ndarray
4210
4202
The matrix-vector product with shape (..., M).
4211
4203
4212
- Raises
4213
- ------
4214
- ValueError
4215
- If any input is a scalar or if the trailing dimension of x2 does not match
4216
- the second-to-last dimension of x1.
4217
-
4218
4204
Notes
4219
4205
-----
4220
4206
This is similar to `matmul` where the second argument is a vector,
@@ -4224,15 +4210,6 @@ def matvec(x1: "ArrayLike", x2: "ArrayLike", dtype: Optional["DTypeLike"] = None
4224
4210
x1 = as_tensor_variable (x1 )
4225
4211
x2 = as_tensor_variable (x2 )
4226
4212
4227
- if x1 .type .ndim == 0 or x2 .type .ndim == 0 :
4228
- raise ValueError ("matvec operand cannot be scalar" )
4229
-
4230
- if x1 .type .ndim < 2 :
4231
- raise ValueError ("First input to matvec must have at least 2 dimensions" )
4232
-
4233
- if x2 .type .ndim < 1 :
4234
- raise ValueError ("Second input to matvec must have at least 1 dimension" )
4235
-
4236
4213
out = _matrix_vec_prod (x1 , x2 )
4237
4214
4238
4215
if dtype is not None :
@@ -4260,12 +4237,6 @@ def vecmat(x1: "ArrayLike", x2: "ArrayLike", dtype: Optional["DTypeLike"] = None
4260
4237
out : ndarray
4261
4238
The vector-matrix product with shape (..., N).
4262
4239
4263
- Raises
4264
- ------
4265
- ValueError
4266
- If any input is a scalar or if the last dimension of x1 does not match
4267
- the second-to-last dimension of x2.
4268
-
4269
4240
Notes
4270
4241
-----
4271
4242
This is similar to `matmul` where the first argument is a vector,
@@ -4275,15 +4246,6 @@ def vecmat(x1: "ArrayLike", x2: "ArrayLike", dtype: Optional["DTypeLike"] = None
4275
4246
x1 = as_tensor_variable (x1 )
4276
4247
x2 = as_tensor_variable (x2 )
4277
4248
4278
- if x1 .type .ndim == 0 or x2 .type .ndim == 0 :
4279
- raise ValueError ("vecmat operand cannot be scalar" )
4280
-
4281
- if x1 .type .ndim < 1 :
4282
- raise ValueError ("First input to vecmat must have at least 1 dimension" )
4283
-
4284
- if x2 .type .ndim < 2 :
4285
- raise ValueError ("Second input to vecmat must have at least 2 dimensions" )
4286
-
4287
4249
out = _vec_matrix_prod (x1 , x2 )
4288
4250
4289
4251
if dtype is not None :
0 commit comments