Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

Fix InferType logic in operators #16757

@anirudh2290

Description

@anirudh2290

Description

Some operators are missing logic for reverse inference: inferring the type of inputs from outputs. Instead, exception is thrown if input dtype is -1.

Also, InferType logic of operators should throw an exception only if both input and output are defined and incompatible with each other. For example. if inputs to an op are -1 and output is -1, the infertype logic should return false, instead of throwing an exception. It should throw an exception only if the types are incompatible: for example both input types and output types are inferred but input types are not compatible with output types.

The above point is important because the InferType NNVM pass does both forward and backward inference. So, sometimes output and input can both be -1 in forward inference but in the backward inference both these values can be inferred.

Operators Impacted

  • fft
  • ifft
  • deformable_convolution
  • multi_sum_sq
  • SequenceReverse
  • Convolution_v1
  • RNN
  • UpSampling
  • BatchNorm
  • Deconvolution
  • LRN
  • Convolution
  • Embedding
  • split_v2
  • SVMOutput
  • SequenceMask
  • SoftmaxOutput
  • BatchNorm_v1

The existing issues with ops was brought up @ptrendx in #16748

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions