Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 26 for GetNodeAttr (0.22 sec)

  1. tensorflow/compiler/jit/shape_inference.cc

          // And Args must have `index` attribute.
          TF_RETURN_IF_ERROR(GetNodeAttr(n->attrs(), "index", &index));
        } else if (n->type_string() == "Placeholder") {
          // Use custom attribute (prefixed with `_`) `_index` for placeholders as
          // they come from user specifications.
          if (const auto s = GetNodeAttr(n->attrs(), "_index", &index); !s.ok()) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri May 31 00:41:19 UTC 2024
    - 13K bytes
    - Viewed (0)
  2. tensorflow/compiler/jit/cluster_scoping_pass_test.cc

    }
    
    absl::flat_hash_map<string, string> GetXlaInternalScopes(const Graph& graph) {
      absl::flat_hash_map<string, string> scopes;
      for (Node* node : graph.nodes()) {
        string scope;
        if (GetNodeAttr(node->attrs(), kXlaInternalScopeAttr, &scope).ok()) {
          scopes[node->name()] = scope;
        }
      }
    
      if (VLOG_IS_ON(2)) {
        VLOG(2) << "_XlaInternalScopes:";
        for (const auto& p : scopes) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed Apr 29 16:20:48 UTC 2020
    - 6.7K bytes
    - Viewed (0)
  3. tensorflow/compiler/jit/encapsulate_xla_computations_pass.cc

        return false;
      }
      return guaranteed_constant;
    }
    
    // Finds the `index` of an _Arg or _Retval node.
    Status GetIndexAttr(const Node& n, int num_args, int* index) {
      TF_RETURN_IF_ERROR(GetNodeAttr(n.attrs(), "index", index));
      if (*index < 0 || *index >= num_args) {
        return errors::InvalidArgument("Invalid ", n.type_string(), " number ",
                                       *index);
      }
      return absl::OkStatus();
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Mar 12 06:33:33 UTC 2024
    - 15.1K bytes
    - Viewed (0)
  4. tensorflow/cc/gradients/data_flow_grad.cc

      // The desired propagation of the gradients back to the data inputs is:
      // [g1, g2, g4, g5, g3]
      auto data = op.input(0);
      auto partitions = op.input(1);
      int32_t num_partitions;
      TF_RETURN_IF_ERROR(
          GetNodeAttr(op.node()->attrs(), "num_partitions", &num_partitions));
    
      // Note: the shape of the partitions is a prefix of the data shape.
      // shape(partitions) = [5]
      auto partitions_shape = Shape(scope, partitions);
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Sat Jul 24 13:40:35 UTC 2021
    - 5.8K bytes
    - Viewed (0)
  5. tensorflow/compiler/jit/cluster_scoping_pass.cc

     private:
      Graph* graph_;
      OptimizerOptions::GlobalJitLevel global_jit_level_;
      size_t unique_scope_id_;
    };
    
    std::optional<string> GetXlaInternalScope(Node* node) {
      string scope;
      if (GetNodeAttr(node->attrs(), kXlaInternalScopeAttr, &scope).ok()) {
        return scope;
      }
    
      return std::nullopt;
    }
    
    void SetXlaInternalScope(Node* node, StringPiece scope) {
      node->AddAttr(kXlaInternalScopeAttr, scope);
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Feb 22 08:47:20 UTC 2024
    - 5.7K bytes
    - Viewed (0)
  6. tensorflow/compiler/jit/clone_constants_for_better_clustering.cc

      }
    
      new_in->set_assigned_device_name(n->assigned_device_name());
      return new_in;
    }
    
    namespace {
    absl::StatusOr<bool> IsConstantSmall(Node* n) {
      const TensorProto* proto = nullptr;
      TF_RETURN_IF_ERROR(GetNodeAttr(n->def(), "value", &proto));
    
      int64_t total_elements = 1;
      for (const auto& dim : proto->tensor_shape().dim()) {
        if (dim.size() < 0) {
          return errors::Internal("Unknown dimension size in constant tensor ",
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Mar 12 06:33:33 UTC 2024
    - 7.3K bytes
    - Viewed (0)
  7. tensorflow/cc/framework/cc_ops_test.cc

      return BiasAdd(cop_scopes.last, m, b);
    }
    
    void GetColocationConstraints(const Output& tensor,
                                  std::vector<string>* constraints) {
      constraints->clear();
      TF_EXPECT_OK(GetNodeAttr(tensor.op().node()->attrs(), kColocationAttrName,
                               constraints));
    }
    
    TEST(CCOpTest, Basic) {
      Scope root = Scope::NewRootScope();
      auto c = Const(root, {{1, 1}});
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Sat Apr 15 15:13:38 UTC 2023
    - 8.7K bytes
    - Viewed (0)
  8. tensorflow/cc/gradients/math_grad.cc

        a = ConjugateHelper(scope, a);
        b = ConjugateHelper(scope, b);
      }
      auto product = op.output(0);
    
      bool ta;
      bool tb;
      TF_RETURN_IF_ERROR(GetNodeAttr(product.node()->attrs(), attr_adj_x, &ta));
      TF_RETURN_IF_ERROR(GetNodeAttr(product.node()->attrs(), attr_adj_y, &tb));
    
      if (!ta && !tb) {
        return MatMulGradHelper(scope, is_batch, grad_inputs[0], false, b, true,
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri Aug 25 18:20:20 UTC 2023
    - 50.7K bytes
    - Viewed (0)
  9. tensorflow/compiler/jit/compilability_check_util.cc

    }
    
    Status MakeCallNodeFromAttribute(const Node& node, const std::string& attr_name,
                                     NodeDef* node_def) {
      const NameAttrList* name_attr;
      TF_RETURN_IF_ERROR(GetNodeAttr(node.attrs(), attr_name, &name_attr));
      node_def->set_op(name_attr->name());
      *(node_def->mutable_attr()) = name_attr->attr();
      return absl::OkStatus();
    }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Mar 12 06:33:33 UTC 2024
    - 30.3K bytes
    - Viewed (0)
  10. tensorflow/compiler/jit/increase_dynamism_for_auto_jit_pass.cc

    StatusOrOptional<Tensor> TryToGetTensorFromConstOp(Node* n) {
      if (n->type_string() != "Const") {
        return {std::nullopt};
      }
    
      const TensorProto* proto = nullptr;
      TF_RETURN_IF_ERROR(GetNodeAttr(n->def(), "value", &proto));
      Tensor tensor(proto->dtype());
      TF_RET_CHECK(tensor.FromProto(*proto));
      return {tensor};
    }
    
    struct SliceInputs {
      Output slice_op;
      Output input;
      Output begin;
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Mar 12 06:33:33 UTC 2024
    - 13.8K bytes
    - Viewed (0)
Back to top