Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 69 for ConstantOp (0.46 sec)

  1. tensorflow/compiler/mlir/lite/utils/lstm_utils.cc

      return builder->create<arith::ConstantOp>(location, type, attr);
    }
    
    Value CreateF32SplatConst(OpBuilder* builder, ArrayRef<int64_t> shape,
                              float val, mlir::Location location) {
      auto type = RankedTensorType::get(shape, builder->getF32Type());
      auto attr = DenseElementsAttr::get(type, val);
      return builder->create<arith::ConstantOp>(location, type, attr);
    }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 36.2K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/lite/transforms/prepare_tf.cc

        auto begin_op =
            rewriter.create<arith::ConstantOp>(op->getLoc(), type, begin_attr);
        auto end_attr = DenseElementsAttr::get<int32_t>(type, padded_end);
        auto end_op =
            rewriter.create<arith::ConstantOp>(op->getLoc(), type, end_attr);
        auto stride_attr = DenseElementsAttr::get<int32_t>(type, padded_stride);
        auto stride_op =
            rewriter.create<arith::ConstantOp>(op->getLoc(), type, stride_attr);
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue May 28 21:49:50 UTC 2024
    - 64.6K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/quantization/stablehlo/passes/post_quantize.cc

          const Type qtype = op.getResult().getType();
          ElementsAttr quantized_attr = Quantize(attr, qtype);
          if (quantized_attr) {
            rewriter.replaceOpWithNewOp<mlir::stablehlo::ConstantOp>(
                op, qtype, quantized_attr);
            return success();
          }
        }
        return failure();
      }
    };
    
    // Replaces quantfork.dcast with stablehlo.uniform_dequantize.
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Mar 05 07:39:40 UTC 2024
    - 6.3K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/lite/transforms/legalize_tf.cc

      // It is legal to have TF ops in the graph still which can be
      // used later or in the case of SELECT where we allow TF ops in the final
      // graph.
      target.addLegalOp<mlir::arith::ConstantOp>();
      target.addLegalOp<mlir::func::ConstantOp>();
      target.addLegalOp<TFL::NoValueOp>();
      target.addLegalOp<ConstOp>();
      target.addLegalOp<DequantizeOp>();
      target.addLegalOp<QConstOp>();
      if (run_tfl_runtime_verification_) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Mon May 20 20:06:54 UTC 2024
    - 45.2K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/tf2xla/transforms/legalize_tf.cc

                                          OpBuilder *builder) {
      auto shape_tensor = builder->create<mhlo::ConstantOp>(
          loc, GetI64ElementsAttr({num_elements}, builder));
    
      auto lower = builder->create<mhlo::ConstantOp>(
          loc, builder->getI32IntegerAttr(lower_limit));
      auto upper = builder->create<mhlo::ConstantOp>(
          loc, builder->getI32IntegerAttr(upper_limit));
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Jun 11 20:00:43 UTC 2024
    - 291.8K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/tfr/passes/decompose.cc

              attr_cst =
                  builder.create<ConstOp>(op->getLoc(), output_type, attribute);
            } else {
              attr_cst = builder.create<mlir::arith::ConstantOp>(
                  op->getLoc(), cast<TypedAttr>(attribute));
            }
            new_operands.push_back(attr_cst);
          }
        }
    
        // Create the TFR call op
        auto new_op = builder.create<CallOp>(
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 14.6K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/lite/stablehlo/transforms/legalize_hlo_conversions/reduce.h

        int64_t axis = reduce_op.getDimensions().getValues<int64_t>()[0];
    
        auto dim_type = RankedTensorType::get({1}, rewriter.getI32Type());
        auto reduction_indices = rewriter.create<arith::ConstantOp>(
            reduce_op.getLoc(), dim_type,
            rewriter.getI32TensorAttr({static_cast<int32_t>(axis)}));
    
        // Generate a Max and an ArgMax of as the mhlo op returns both while in TF
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 5.7K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/quantization/common/quantization_lib/quantization_driver_test.cc

          /*infer_tensor_range=*/true, /*legacy_float_scale=*/false,
          /*is_qdq_conversion=*/false);
    
      quantization_driver.Initialize();
    
      int64_t num_constant_op = 0;
      main_fn.walk([&](arith::ConstantOp cst) { ++num_constant_op; });
      EXPECT_EQ(num_constant_op, 4);
    }
    
    TEST_F(ApplyQuantizationParamsPropagationTest,
           PropagateParamsCreatesQuantState) {
      const OwningOpRef<ModuleOp> module_op_ref =
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 7.9K bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/tensorflow/transforms/initialize_variables_in_session_init.cc

      builder.setInsertionPointToStart(&session_init_func.getBlocks().front());
      auto var_handle_op_in_init = var_handle_op->clone();
      builder.insert(var_handle_op_in_init);
      auto const_op = builder.create<mlir::arith::ConstantOp>(
          session_init_func.getLoc(), tensor_attr.getType(), tensor_attr);
    
      builder.create<TF::AssignVariableOp>(
          session_init_func.getLoc(), llvm::ArrayRef<mlir::Type>{},
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu May 23 09:05:47 UTC 2024
    - 7K bytes
    - Viewed (0)
  10. tensorflow/compiler/mlir/quantization/common/attrs_and_constraints.td

    def DefaultOrNullAttr : NativeCodeCall<"DefaultOrNullAttr($_builder, $0)">;
    
    // Returns true if the given op is a StableHLO constant op.
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri Mar 08 04:55:44 UTC 2024
    - 6.7K bytes
    - Viewed (0)
Back to top