Skip to content

0.6.4

Choose a tag to compare

@arcondello arcondello released this 06 Aug 22:17
· 303 commits to main since this release
86d11fb

New Features

  • Add ArgSort symbol/node which returns a stable argsort of its
    predecessor.
  • Add expression() decorator for constructing expressions.
  • Add the AccumulateZip symbol and corresponding AccumulateZipNode
    node in the C++. This symbol computes an arbitrary accumulate
    operation on 1-d arrays, similar to numpy.ufunc.accumulate, except
    that it takes any number of operands/predecessors. The accumulate
    operation is supplied by the user and encoded as an Expression.
  • The Constant symbol is now able to pass ownership of the
    corresponding numpy array to the ConstantNode which prevents the
    numpy array from being garbage collected even after the symbol has
    been collected. This means it is no longer necessary to save
    references to all the numpy arrays used by Constant symbols on the
    model itself. To support this, a new constructor for the C++
    ConstantNode has been added which takes a special
    ConstantNode::DataSource struct allowing the Python reference
    count to modified when appropriate.
  • Support automatic constant promotion for arithmetic operations on
    Symbols. This enables operations like model.binary() + 5, where
    the 5 will automatically be converted to a Constant symbol and
    added to the model.
  • Add std::initializer_list and std::span overloads to several
    InputNode methods.
  • Allow the user to provide an initial value to ArraySymbol.max(),
    .min(), .prod(), and .sum() methods.
  • Add Resize symbol and C++ ResizeNode.
  • Change the behavior of Model.constant() to keep a cache of
    symbols. Multiple calls to Model.constant() with the same array
    will no longer create redundant symbols.
  • Add C++ deduplicate_diff_view range view.
  • Add C++ type_list utility class.
  • Added Mean symbol/node which returns the mean of its predecessor.
  • Add support for Python 3.14.

Upgrade Notes

  • Move C++ deduplicate_diff() function from
    dwave-optimization/utils.hpp to dwave-optimization/array.hpp.
  • Change the signatures of the C++ ravel_multi_index() and
    unravel_index() functions to accept shapes rather than strides.
    This is consistent with NumPy.
  • Remove C++ Array::View::at() method.

Bug Fixes

  • Implement the C++ UnaryOpNode::sizeinfo() method to handle unary
    operations on dynamic arrays.
  • There was an issue on some models with "diamonds" in the multi-DAG
    structure where adding subsequent nodes could trigger a exponential
    recursion of calling Array::min()/max(). This has been fixed by
    using a min/max cache by default in these methods.