class_docstr: Image preprocessing layer (specification key: `image`).
  
  Args:
      height (int): Height of resized image
          (<span style="color:#00C000"><b>default</b></span>: no resizing or relative to width).
      width (int): Width of resized image
          (<span style="color:#00C000"><b>default</b></span>: no resizing or relative to height).
      grayscale (bool | iter[float]): Turn into grayscale image, optionally using given weights
          (<span style="color:#00C000"><b>default</b></span>: false).
      name (string): Layer name
          (<span style="color:#00C000"><b>default</b></span>: internally chosen).
      input_spec (specification): <span style="color:#00C000"><b>internal use</b></span>.
class_docstr_tok: ["Image","preprocessing","layer","(","specification","key",":","`","image","`",")",".","Args",":","height","(","int",")",":","Height","of","resized","image","(","<","span","style=","''","color",":","#","00C000","''",">","<","b",">","default","<","\/b",">","<","\/span",">",":","no","resizing","or","relative","to","width",")",".","width","(","int",")",":","Width","of","resized","image","(","<","span","style=","''","color",":","#","00C000","''",">","<","b",">","default","<","\/b",">","<","\/span",">",":","no","resizing","or","relative","to","height",")",".","grayscale","(","bool","|","iter","[","float","]",")",":","Turn","into","grayscale","image",",","optionally","using","given","weights","(","<","span","style=","''","color",":","#","00C000","''",">","<","b",">","default","<","\/b",">","<","\/span",">",":","false",")",".","name","(","string",")",":","Layer","name","(","<","span","style=","''","color",":","#","00C000","''",">","<","b",">","default","<","\/b",">","<","\/span",">",":","internally","chosen",")",".","input_spec","(","specification",")",":","<","span","style=","''","color",":","#","00C000","''",">","<","b",">","internal","use","<","\/b",">","<","\/span",">","."]
code: def output_spec(self):
      output_spec = super().output_spec()
  
      if self.height is not None:
          if self.width is None:
              self.width = round(
                  self.height
                  * output_spec.shape[1]
                  / output_spec.shape[0]
              )
          output_spec.shape = (
              self.height,
              self.width,
              output_spec.shape[2],
          )
      elif self.width is not None:
          self.height = round(
              self.width * output_spec.shape[0] / output_spec.shape[1]
          )
          output_spec.shape = (
              self.height,
              self.width,
              output_spec.shape[2],
          )
  
      if not isinstance(self.grayscale, bool) or self.grayscale:
          output_spec.shape = output_spec.shape[:2] + (1,)
  
      return output_spec
  
imports: import tensorflow
  from tensorforce.core import parameter_modules, SignatureDict, TensorSpec, tf_function, tf_util
  from tensorforce.core.layers import Layer
label_desc: Use image node_id 3 for calling the Image obj's underlying member method code with example usage: obj.output_spec() and returns: output_spec