tweak numpy code
This commit is contained in:
@@ -692,8 +692,9 @@ def dot_variable_container(
|
||||
) -> LinearExprT:
|
||||
"""Implementation of np.dot for VariableContainer objects."""
|
||||
if len(container.shape) != 1:
|
||||
raise TypeError(
|
||||
'dot_variable_container only supports 1D variable containers')
|
||||
raise ValueError(
|
||||
'dot_variable_container only supports 1D variable containers (shape ='
|
||||
f' {container.shape}')
|
||||
indices: npt.NDArray[np.int32] = container.variable_indices
|
||||
if np.isscalar(arg):
|
||||
return _WeightedSum(
|
||||
|
||||
@@ -30,8 +30,7 @@ def main():
|
||||
[45, 110, 95, 115],
|
||||
[50, 100, 90, 100],
|
||||
])
|
||||
num_workers = len(costs)
|
||||
num_tasks = len(costs[0])
|
||||
num_workers, num_tasks = costs.shape
|
||||
# [END data_model]
|
||||
|
||||
# Solver
|
||||
|
||||
Reference in New Issue
Block a user