Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 78 for varhandle_op (0.47 sec)

  1. tensorflow/c/experimental/saved_model/core/ops/variable_ops.cc

                                               ImmediateTensorHandlePtr* handle) {
      ImmediateOpPtr varhandle_op(ctx->CreateOperation());
    
      TF_RETURN_IF_ERROR(varhandle_op->Reset("VarHandleOp", raw_device_name));
      TF_RETURN_IF_ERROR(varhandle_op->SetAttrType("dtype", dtype));
    
      // Note that if shape is unknown rank, shape.dim_sizes() will be empty, and
      // shape.dims() will be -1.
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Apr 23 11:28:19 UTC 2024
    - 5K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/quantization/tensorflow/passes/insert_save_op.cc

    }
    
    // Returns cloned `VarHandleOp`s. Assumes `save_func`'s body is empty.
    SmallVector<TF::VarHandleOp> CloneVarHandleOpsIntoSaveFunc(
        func::FuncOp save_func, const ArrayRef<TF::VarHandleOp> var_handle_ops) {
      Block& save_op_block = save_func.getBody().front();
    
      IRMapping mapper{};
      SmallVector<TF::VarHandleOp> cloned_var_handle_ops = {};
      for (auto var_handle_op : var_handle_ops) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri Mar 22 05:52:39 UTC 2024
    - 9.5K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/quantization/tensorflow/passes/insert_restore_op.cc

            var_handle_op &&
            isa<TF::ConstOp>(assigned_value_operand.getDefiningOp())) {
          var_handle_ops.emplace_back(var_handle_op);
        }
      }
    
      return var_handle_ops;
    }
    
    // Creates a `ConstOp` of 1-dimensional TF::StringType out of `str_values`.
    TF::ConstOp Create1DStringConst(const ArrayRef<std::string> str_values,
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Sun Mar 12 06:02:20 UTC 2023
    - 9K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/tensorflow/transforms/hoist_loop_invariant.cc

      // hoisted.
      auto read_var_op = llvm::dyn_cast<ReadVariableOp>(op);
      if (!read_var_op) return false;
      auto var_handle_op = llvm::dyn_cast_or_null<VarHandleOp>(
          read_var_op.getResource().getDefiningOp());
      if (!var_handle_op) return false;
      return read_only_vars.contains(GetResourceHandle(var_handle_op));
    }
    
    bool ShouldMoveOutOfRegion(
        Operation *op, Region *region,
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 5.3K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/lite/transforms/quantize_variables.cc

        }
      }
      // Update resource tensors.
      for (VarHandleOp var_handle_op : var_handle_ops) {
        builder.setInsertionPoint(var_handle_op);
        auto output_type = UnrankedTensorType::get(TF::ResourceType::get(
            {mlir::cast<TensorType>(ref_qtype)}, builder.getContext()));
        auto new_var_handle_op = builder.create<VarHandleOp>(
            var_handle_op.getLoc(), output_type, var_handle_op.getContainer(),
            var_handle_op.getSharedName());
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 8.5K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/tensorflow/utils/session_utils.cc

        llvm::ArrayRef<TF::VarHandleOp> var_handle_ops) {
      std::vector<std::string> names;
      names.reserve(var_handle_ops.size());
      for (auto var_handle_op : var_handle_ops)
        names.push_back(GetVariableName(var_handle_op));
      return names;
    }
    
    tensorflow::Var* GetVariableFromSession(mlir::TF::VarHandleOp var_handle_op,
                                            llvm::StringRef device_name,
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 3.2K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/tensorflow/utils/session_utils.h

    // Returns the variable for the provided 'var_handle_op'.
    std::string GetVariableName(TF::VarHandleOp var_handle_op);
    
    // Returns pointer to the variable from 'session' that 'var_handle_op'
    // refers to which is in 'device_name' device. If failed to fetch the value null
    // will be returned.
    // Note, caller is responsible for Unref the variable.
    tensorflow::Var* GetVariableFromSession(mlir::TF::VarHandleOp var_handle_op,
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Jun 06 04:50:13 UTC 2023
    - 2.1K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/tensorflow/transforms/mark_initialized_variables.cc

        return function->emitError(
            absl::StrCat("failed to fetch device manager: ", status.message()));
    
      // Fetch all varHandleOp in the function.
      llvm::SmallVector<TF::VarHandleOp, 4> var_ops;
      for (auto var_handle_op : block.getOps<TF::VarHandleOp>())
        var_ops.emplace_back(var_handle_op);
    
      // Get resources from Session.
      auto resource_tensors_or = GetResourcesFromSession(var_ops, session);
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 13 19:14:56 UTC 2023
    - 4.1K bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/tensorflow/transforms/resource_analyzer_test_pass.cc

      StringRef shared_name;
    };
    
    ResourceKey GetResourceKey(TF::VarHandleOp var_handle_op) {
      ResourceKey resource_key;
    
      if (auto attr = var_handle_op->getAttrOfType<StringAttr>("device")) {
        resource_key.device = attr.getValue();
      }
    
      resource_key.container = var_handle_op.getContainer();
      resource_key.shared_name = var_handle_op.getSharedName();
    
      return resource_key;
    }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri Mar 03 00:21:29 UTC 2023
    - 3K bytes
    - Viewed (0)
  10. tensorflow/compiler/mlir/tensorflow/transforms/remove_vars_in_session_initializer.cc

          return signalPassFailure();
        }
    
        auto var_handle_ops =
            init_func_op.getBlocks().front().getOps<VarHandleOp>();
        llvm::SmallVector<VarHandleOp, 4> init_vars(var_handle_ops.begin(),
                                                    var_handle_ops.end());
        RemoveVariables(init_vars);
      }
    }
    
    }  // namespace
    
    std::unique_ptr<OperationPass<ModuleOp>>
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 3.6K bytes
    - Viewed (0)
Back to top