Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 17 for _composite_op (0.14 sec)

  1. tensorflow/compiler/mlir/tfr/python/op_reg_gen_test.py

      pass
    
    
    @Composite(
        'TestCompositeOp',
        inputs=['x: T', 'y: T'],
        attrs=['act: {"", "relu"}', 'trans: bool = true'],
        derived_attrs=['T: numbertype'],
        outputs=['o1: T', 'o2: T'])
    def _composite_op(x, y, act, trans):
      return x + act, y + trans
    
    
    class TFRGenTensorTest(test.TestCase):
      """MLIR Generation Tests for MLIR TFR Program."""
    
      def test_op_reg_gen(self):
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Sep 28 21:37:05 UTC 2021
    - 2.5K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/lite/stablehlo/odml_converter/transforms/outline_composites.cc

            {rewriter.getNamedAttr("approx", rewriter.getBoolAttr(false))});
        auto composite_op = rewriter.create<stablehlo::CompositeOp>(
            output_mul.getLoc(), func.getResultTypes()[0],
            SmallVector<Value>{erf_input->getOperand(0)}, MakeCompositeName(kGelu),
            composite_attrs, func.getSymName());
        rewriter.replaceAllOpUsesWith(output_mul, composite_op);
        // Note these must be erased in reverse topo order to avoid
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri May 17 17:58:54 UTC 2024
    - 9.6K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/tfr/resources/composite_ops.cc

    Feng Liu <******@****.***> 1600895290 -0700
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed Sep 23 21:28:23 UTC 2020
    - 1.3K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/lite/stablehlo/transforms/legalize_stablehlo_composite_to_tfl_custom.cc

    namespace {
    bool IsSupportedComposite(::mlir::stablehlo::CompositeOp op) {
      // List of supported composites to represent using CustomOp.
      return llvm::is_contained(
          {"odml.update_kv_cache", "odml.scaled_dot_product_attention"},
          op.getName());
    }
    
    bool IsKVCacheCompositeOp(::mlir::stablehlo::CompositeOp op) {
      return op.getName() == "odml.update_kv_cache";
    }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 6.8K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/lite/stablehlo/transforms/composite_avg_pool_patterns.td

    
    // See the function doc in the header file.
    def GetPadOpType : NativeCodeCall<
      "GetPadOpType((*$0.begin()).getDefiningOp<mhlo::CompositeOp>())">;
    
    // See the function doc in the header file.
    def GetAvgPoolOpPadAttr: 
      NativeCodeCall<"GetAvgPoolOpPadAttr($_builder, (*$0.begin()).getDefiningOp<mhlo::CompositeOp>())">;
    
    // Returns true if the provided padding in the composite op can *not* be 
    // satisfied by SAME or VALID tensorflow padding.
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue May 28 23:16:05 UTC 2024
    - 7.8K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/lite/stablehlo/transforms/composite_avg_pool.h

    DenseIntElementsAttr GetPadOpAttr(Builder& builder, mhlo::CompositeOp op);
    
    // Given a Composite op that wraps a core.aten.avg_pool2d, and assuming that
    // the padding part is extracted into a tfl.pad op prior to a
    // tfl.average_pool_2d, this function finds the return type of the needed
    // tfl.pad .
    ShapedType GetPadOpType(mhlo::CompositeOp op);
    
    // Given a Composite op that wraps a core.aten.avg_pool2d, finds the padding
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue May 28 23:16:05 UTC 2024
    - 2.5K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/tensorflow/transforms/promote_resources_to_args.cc

    mlir::LogicalResult ValidateVarHandle(TF::VarHandleOp var_handle_op) {
      auto composite_ops = GetCompositeResourceUserNames(var_handle_op);
      if (!composite_ops.empty())
        return var_handle_op.emitOpError()
               << "expects users to be 'tf.ReadVariableOp' or "
                  "'tf.AssignVariableOp', got ["
               << llvm::join(composite_ops.begin(), composite_ops.end(), ", ")
               << "]";
    
      return success();
    }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 17.1K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/lite/stablehlo/transforms/composite_avg_pool.cc

    #include "tensorflow/compiler/mlir/lite/transforms/passes.h"  // IWYU pragma: keep
    #include "xla/mlir_hlo/mhlo/IR/hlo_ops.h"  // IWYU pragma: keep
    
    namespace mlir {
    namespace odml {
    
    using mhlo::CompositeOp;
    
    // Struct for holding composite attrs for torch average pool as CC types.
    struct TorchAvgPoolData {
      int n;  // Batch.
      int c;  // Channels.
    
      int h_in;  // Input height.
      int w_in;  // Input width.
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue May 28 23:16:05 UTC 2024
    - 9.2K bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/tfr/define_op_template.py

    
    def main(_):
      if FLAGS.gen_register_op:
        assert FLAGS.output.endswith('.cc')
        generated_code = gen_register_op(sys.modules[__name__], '_composite_')
      else:
        assert FLAGS.output.endswith('.mlir')
        generated_code = tfr_gen_from_module(sys.modules[__name__], '_composite_')
    
      dirname = os.path.dirname(FLAGS.output)
      if not os.path.exists(dirname):
        os.makedirs(dirname)
      with open(FLAGS.output, 'w') as f:
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Sep 28 21:37:05 UTC 2021
    - 1.9K bytes
    - Viewed (0)
  10. tensorflow/compiler/mlir/tfr/examples/pad/ops_defs.py

    
    def main(_):
      if FLAGS.gen_register_op:
        assert FLAGS.output.endswith('.cc')
        generated_code = gen_register_op(sys.modules[__name__], '_composite_')
      else:
        assert FLAGS.output.endswith('.mlir')
        generated_code = tfr_gen_from_module(sys.modules[__name__], '_composite_')
    
      dirname = os.path.dirname(FLAGS.output)
      if not os.path.exists(dirname):
        os.makedirs(dirname)
      with open(FLAGS.output, 'w') as f:
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri Oct 01 05:00:29 UTC 2021
    - 5.6K bytes
    - Viewed (0)
Back to top