class_docstr: SlidingWindow operator.
class_docstr_tok: ["SlidingWindow","operator","."]
docstr: Applies a sliding window of size n to the list of artifacts.
  
  For example, for artifacts [A, B, C, D] with n=2, then a sliding window of 2
  will be applied, producing [[A, B], [B, C], [C, D]]. The stride is set to 1
  by default.
  
  Note that what will actually be returned is a an ARTIFACT_MULTIMAP_LIST:
  [{"window": [A, B]}, {"window": [B, C]}, {"window": [C, D]}]. The output_key
  is set to "window" by default.
  
  This is because a type of ARTIFACT_LIST_LIST is not yet supported in the IR
  compilation. The dictionaries will have to be unnested in the resolver
  function SlidingWindow is called in.
  
  Args:
    input_list: The Artifacts to filter.
  
  Returns:
    The artifacts with the sliding window applied, in list of dictionaries
      format.
docstr_tok: ["Applies","a","sliding","window","of","size","n","to","the","list","of","artifacts",".","For","example",",","for","artifacts","[","A",",","B",",","C",",","D","]","with","n=2",",","then","a","sliding","window","of","2","will","be","applied",",","producing","[","[","A",",","B","]",",","[","B",",","C","]",",","[","C",",","D","]","]",".","The","stride","is","set","to","1","by","default",".","Note","that","what","will","actually","be","returned","is","a","an","ARTIFACT_MULTIMAP_LIST",":","[","{","``","window","''",":","[","A",",","B","]","}",",","{","``","window","''",":","[","B",",","C","]","}",",","{","``","window","''",":","[","C",",","D","]","}","]",".","The","output_key","is","set","to","``","window","''","by","default",".","This","is","because","a","type","of","ARTIFACT_LIST_LIST","is","not","yet","supported","in","the","IR","compilation",".","The","dictionaries","will","have","to","be","unnested","in","the","resolver","function","SlidingWindow","is","called","in",".","Args",":","input_list",":","The","Artifacts","to","filter",".","Returns",":","The","artifacts","with","the","sliding","window","applied",",","in","list","of","dictionaries","format","."]
code: def apply(
      self, input_list: Sequence[types.Artifact]
  ) -> Sequence[Mapping[str, Sequence[types.Artifact]]]:
      """Applies a sliding window of size n to the list of artifacts.
  
      For example, for artifacts [A, B, C, D] with n=2, then a sliding window of 2
      will be applied, producing [[A, B], [B, C], [C, D]]. The stride is set to 1
      by default.
  
      Note that what will actually be returned is a an ARTIFACT_MULTIMAP_LIST:
      [{"window": [A, B]}, {"window": [B, C]}, {"window": [C, D]}]. The output_key
      is set to "window" by default.
  
      This is because a type of ARTIFACT_LIST_LIST is not yet supported in the IR
      compilation. The dictionaries will have to be unnested in the resolver
      function SlidingWindow is called in.
  
      Args:
        input_list: The Artifacts to filter.
  
      Returns:
        The artifacts with the sliding window applied, in list of dictionaries
          format.
      """
      if self.window_size < 1:
          raise ValueError(
              f"sliding_window must be > 0, but was set to {self.window_size}."
          )
  
      if not input_list:
          return []
  
      num_windows = len(input_list) - self.window_size + 1
      windows = [
          input_list[i : (i + self.window_size)]
          for i in range(num_windows)
      ]
      return [{self.output_key: window} for window in windows]
  
imports: from typing import Sequence, Mapping
  from tfx import types
  from tfx.dsl.input_resolution import resolver_op
label_desc: Use image node_id 1 for calling the SlidingWindow obj's underlying member method code with example usage: obj.apply(input_list) and returns: unknown, list