class_docstr: Model defined by a stack of layers in sequence.
class_docstr_tok: ["Model","defined","by","a","stack","of","layers","in","sequence","."]
docstr: Sets the weights of the model.
  
  Arguments:
    weights: A list of Numpy arrays with shapes and types
      matching the output of model.get_weights()
docstr_tok: ["Sets","the","weights","of","the","model",".","Arguments",":","weights",":","A","list","of","Numpy","arrays","with","shapes","and","types","matching","the","output","of","model.get_weights","(",")"]
code: def set_weights(self, weights):
      """Sets the weights of the model.
  
      Arguments:
        weights: A list of Numpy arrays with shapes and types
          matching the output of model.get_weights()
      """
      if not isinstance(weights[0], list):
          new_weights = []
          for layer in self.layers:
              new_weights.append(weights[: len(layer.weights)])
              weights = weights[len(layer.weights) :]
          weights = new_weights
  
      # Updated weights for each layer
      for index, weight in enumerate(weights):
          if len(weight) == 0:
              continue
          self.layers[index].set_weights(weight)
  
file_path: tf-encrypted/tf_encrypted/keras/models/sequential.py
imports: import tensorflow
  import tf_encrypted
  from tf_encrypted.keras import optimizers
  from tf_encrypted.keras.engine import Layer
  from tf_encrypted.keras.engine.input_layer import Input
  from tf_encrypted.keras.engine.input_layer import InputLayer
  from .base_model import BaseModel
label_desc: Use image node_id 7 for calling the Sequential obj's underlying member method code with example usage: obj.set_weights(weights) without return types