Home | History | Annotate | Download | only in lib
      1 /* Copyright 2017 The TensorFlow Authors. All Rights Reserved.
      2 
      3 Licensed under the Apache License, Version 2.0 (the "License");
      4 you may not use this file except in compliance with the License.
      5 You may obtain a copy of the License at
      6 
      7     http://www.apache.org/licenses/LICENSE-2.0
      8 
      9 Unless required by applicable law or agreed to in writing, software
     10 distributed under the License is distributed on an "AS IS" BASIS,
     11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     12 See the License for the specific language governing permissions and
     13 limitations under the License.
     14 ==============================================================================*/
     15 
     16 #ifndef TENSORFLOW_COMPILER_TF2XLA_LIB_CHOLESKY_H_
     17 #define TENSORFLOW_COMPILER_TF2XLA_LIB_CHOLESKY_H_
     18 
     19 #include "tensorflow/compiler/xla/client/computation.h"
     20 #include "tensorflow/compiler/xla/client/computation_builder.h"
     21 
     22 namespace tensorflow {
     23 
     24 // Computes the Cholesky decompositions of a batch of symmetric positive
     25 // definite matrices.
     26 // `a` must be a (batched) square matrix; i.e., it must have rank >= 2 with the
     27 // two minor dimensions equal.
     28 // The algorithm implements a blocked Cholesky decomposition; `block_size` is
     29 // the block size to use.
     30 // TODO(phawkins): check for negative values on the diagonal and return an
     31 // error, instead of silently yielding NaNs.
     32 // TODO(mattjj): handle the complex Hermitian case
     33 xla::StatusOr<xla::ComputationDataHandle> Cholesky(
     34     xla::ComputationBuilder* builder, xla::ComputationDataHandle a,
     35     int64 block_size = 256);
     36 
     37 }  // namespace tensorflow
     38 
     39 #endif  // TENSORFLOW_COMPILER_TF2XLA_LIB_CHOLESKY_H_
     40