• Adam Rogowiec's avatar
    [ONNX] Fix backward pass for bidirectional LSTM. (#3194) · 7ccb6cf1
    Adam Rogowiec authored
    * Fix used operator for reversing input sequences in LSTM.
    
    * Fix backward pass for bidirectional LSTM.
    
    * UT for LSTM with sequence_lens shorter than input sequence size.
    
    * Skip LSTM UT using ReverseSequence since it is not supported yet on
    PlaidML.
    7ccb6cf1
lstm_mixed_seq_reverse.prototxt 2.64 KB
ir_version: 5
graph {
  node {
    input: "X"
    input: "W"
    input: "R"
    input: ""
    input: "sequence_lens"
    input: ""
    input: ""
    input: ""
    output: "Y"
    output: "Y_h"
    output: "Y_c"
    name: "node1"
    op_type: "LSTM"
    attribute {
      name: "direction"
      s: "reverse"
      type: STRING
    }
    attribute {
      name: "input_forget"
      i: 0
      type: INT
    }
    attribute {
      name: "activations"
      strings: "sigmoid"
      strings: "tanh"
      strings: "tanh"
      type: STRINGS
    }
    attribute {
      name: "hidden_size"
      i: 3
      type: INT
    }
    attribute {
      name: "clip"
      f: 9999
      type: FLOAT
    }
    doc_string: "LSTM"
    domain: ""
  }
  input {
    name: "X"
    type {
      tensor_type {
        elem_type: 1
        shape {
          dim {
            dim_value: 2
          }
          dim {
            dim_value: 2
          }
          dim {
            dim_value: 1
          }
        }
      }
    }
  }
  input {
    name: "W"
    type {
      tensor_type {
        elem_type: 1
        shape {
          dim {
            dim_value: 1
          }
          dim {
            dim_value: 12
          }
          dim {
            dim_value: 1
          }
        }
      }
    }
  }
  input {
    name: "R"
    type {
      tensor_type {
        elem_type: 1
        shape {
          dim {
            dim_value: 1
          }
          dim {
            dim_value: 12
          }
          dim {
            dim_value: 3
          }
        }
      }
    }
  }
  input {
    name: "sequence_lens"
    type {
      tensor_type {
        elem_type: 6
        shape {
          dim {
            dim_value: 2
          }
        }
      }
    }
  }
  output {
    name: "Y"
    type {
      tensor_type {
        elem_type: 1
        shape {
          dim {
            dim_value: 2
          }
          dim {
            dim_value: 1
          }
          dim {
            dim_value: 2
          }
          dim {
            dim_value: 3
          }
        }
      }
    }
  }
  output {
    name: "Y_h"
    type {
      tensor_type {
        elem_type: 1
        shape {
          dim {
            dim_value: 1
          }
          dim {
            dim_value: 2
          }
          dim {
            dim_value: 3
          }
        }
      }
    }
  }
  output {
    name: "Y_c"
    type {
      tensor_type {
        elem_type: 1
        shape {
          dim {
            dim_value: 1
          }
          dim {
            dim_value: 2
          }
          dim {
            dim_value: 3
          }
        }
      }
    }
  }
}
opset_import {
  domain: ""
  version: 7
}