org.apache.sysds.hops.ipa

## Class IPAPassRemoveConstantBinaryOps

- java.lang.Object
- - org.apache.sysds.hops.ipa.IPAPass
  - - org.apache.sysds.hops.ipa.IPAPassRemoveConstantBinaryOps

-     public class IPAPassRemoveConstantBinaryOps
      extends IPAPass

  This rewrite identifies binary operations with constant matrices such as X * ones, where ones might be created as a vector of ones before a loop. Such operations frequently occur after branch removal for fixed configurations or loss functions.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `IPAPassRemoveConstantBinaryOps()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `isApplicable(FunctionCallGraph fgraph)` Indicates if an IPA pass is applicable for the current configuration such as global flags or the chosen execution mode (e.g., HYBRID).
    `boolean` | `rewriteProgram(DMLProgram prog, FunctionCallGraph fgraph, FunctionCallSizeInfo fcallSizes)` Rewrites the given program or its functions in place, with access to the read-only function call graph.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### IPAPassRemoveConstantBinaryOps

          public IPAPassRemoveConstantBinaryOps()

  - ### Method Detail

    - #### isApplicable

          public boolean isApplicable(FunctionCallGraph fgraph)

      Description copied from class: `IPAPass`
      Indicates if an IPA pass is applicable for the current configuration such as global flags or the chosen execution mode (e.g., HYBRID).
      Specified by:
        `isApplicable` in class `IPAPass`
      Parameters:
        `fgraph` - function call graph
      Returns:
        true if applicable.

    - #### rewriteProgram

          public boolean rewriteProgram(DMLProgram prog,
                                        FunctionCallGraph fgraph,
                                        FunctionCallSizeInfo fcallSizes)

      Description copied from class: `IPAPass`
      Rewrites the given program or its functions in place, with access to the read-only function call graph.
      Specified by:
        `rewriteProgram` in class `IPAPass`
      Parameters:
        `prog` - dml program
        `fgraph` - function call graph
        `fcallSizes` - function call size infos
      Returns:
        true if function call graph should be rebuild

Copyright © 2021 The Apache Software Foundation. All rights reserved.