class_docstr: An agent has an input size, an output size, a number of layers, a width of its internal layers
  (a.k.a number of neurons per hidden layer).
class_docstr_tok: ["An","agent","has","an","input","size",",","an","output","size",",","a","number","of","layers",",","a","width","of","its","internal","layers","(","a.k.a","number","of","neurons","per","hidden","layer",")","."]
code: def set_parameters(self, weights: np.ndarray) -> None:
      if weights.size != self.dimension:
          raise ValueError(
              f"length = {weights.size} instead of {self.dimension}: {weights}."
          )
      start = 0
      for i, layer in enumerate(self.layers):
          numel = layer.size
          self.layers[i] = weights[start : start + numel].reshape(
              layer.shape
          )
          start += numel
      if start != weights.size:
          raise RuntimeError(
              "Unexpected runtime error when distributing the weights"
          )
  
file_path: nevergrad/nevergrad/functions/powersystems/core.py
imports: import typing
  from math import pi, cos, sin
  import matplotlib.pyplot
  import numpy
  from nevergrad.parametrization import parameter
  from ..base import ExperimentFunction
label_desc: Use image node_id 3 for calling the Agent obj's underlying member method code with example usage: obj.set_parameters(weights) without return types