parameters: (self, in_, mean)
docstring: Set the mean to subtract for centering the data.
  
          Take
          in_: which input to assign this mean.
          mean: mean ndarray (input dimensional or broadcastable)
docstring_summary: Set the mean to subtract for centering the data.
docstring_tokens: Set the mean to subtract for centering the data .
function: def set_mean(self, in_, mean):
          """
          Set the mean to subtract for centering the data.
  
          Take
          in_: which input to assign this mean.
          mean: mean ndarray (input dimensional or broadcastable)
          """
          self.__check_input(in_)
          ms = mean.shape
          if mean.ndim == 1:
              # broadcast channels
              if ms[0] != self.inputs[in_][1]:
                  raise ValueError('Mean channels incompatible with input.')
              mean = mean[:, np.newaxis, np.newaxis]
          else:
              # elementwise mean
              if len(ms) == 2:
                  ms = (1,) + ms
              if len(ms) != 3:
                  raise ValueError('Mean shape invalid')
              if ms != self.inputs[in_][1:]:
                  raise ValueError('Mean shape incompatible with input shape.')
          self.mean[in_] = mean
function_tokens: def set_mean ( self , in_ , mean ) : self . __check_input ( in_ ) ms = mean . shape if mean . ndim == 1 : # broadcast channels if ms [ 0 ] != self . inputs [ in_ ] [ 1 ] : raise ValueError ( 'Mean channels incompatible with input.' ) mean = mean [ : , np . newaxis , np . newaxis ] else : # elementwise mean if len ( ms ) == 2 : ms = ( 1 , ) + ms if len ( ms ) != 3 : raise ValueError ( 'Mean shape invalid' ) if ms != self . inputs [ in_ ] [ 1 : ] : raise ValueError ( 'Mean shape incompatible with input shape.' ) self . mean [ in_ ] = mean