Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 18 for Unref (0.14 sec)

  1. tensorflow/c/experimental/gradients/tape/tape_context.cc

      // TODO(srbs): Make AbstractContext ref counted.
      // parent_ctx_->Ref();
    }
    void TapeContext::Release() {
      // TODO(srbs): Change to Unref()
      delete this;
    }
    TapeContext::~TapeContext() {
      // TODO(srbs): Make AbstractContext ref counted.
      // parent_ctx_->Unref();
    }
    TapeOperation* TapeContext::CreateOperation() {
      return new TapeOperation(parent_ctx_->CreateOperation(), tape_, registry_);
    }
    C++
    - Registered: Tue Feb 27 12:39:08 GMT 2024
    - Last Modified: Wed Sep 23 23:12:39 GMT 2020
    - 1.7K bytes
    - Viewed (0)
  2. tensorflow/c/experimental/gradients/nn_grad.cc

                                    &grad_inputs[0], name.c_str()));
        return absl::OkStatus();
      }
      ~ReluGradientFunction() override {
        for (auto output : forward_outputs_) {
          if (output) {
            output->Unref();
          }
        }
      }
    
     private:
      // TODO(b/174778737): Only hold needed outputs.
      vector<AbstractTensorHandle*> forward_outputs_;
    };
    
    Status BroadcastMul(AbstractContext* ctx, AbstractTensorHandle* vec,
    C++
    - Registered: Tue Mar 26 12:39:09 GMT 2024
    - Last Modified: Wed Feb 28 13:53:47 GMT 2024
    - 5.7K bytes
    - Viewed (0)
  3. tensorflow/c/experimental/gradients/custom_gradient_test.cc

                                              /*sources=*/inputs,
                                              /*output_gradients=*/{},
                                              /*result=*/outputs));
      exp_output->Unref();
      return absl::OkStatus();
    }
    
    TEST_P(CustomGradientTest, ExpWithPassThroughGrad) {
      std::unique_ptr<TF_Status, decltype(&TF_DeleteStatus)> status(
          TF_NewStatus(), TF_DeleteStatus);
      AbstractContextPtr ctx;
    C++
    - Registered: Tue Mar 26 12:39:09 GMT 2024
    - Last Modified: Wed Feb 28 13:53:47 GMT 2024
    - 4.8K bytes
    - Viewed (0)
  4. tensorflow/c/experimental/gradients/grad_test_helper.cc

          ASSERT_NEAR(dnumerical[j], danalytical[j], abs_error);
        }
        TF_DeleteTensor(analytical_tensor);
        TF_DeleteTensor(numerical_tensor);
        delete[] danalytical;
        delete[] dnumerical;
        outputs[i]->Unref();
      }
    }
    
    void CheckTensorValue(AbstractTensorHandle* t, absl::Span<const float> manuals,
                          absl::Span<const int64_t> dims, double abs_error) {
      TF_Tensor* analytical_tensor;
    C++
    - Registered: Tue Mar 26 12:39:09 GMT 2024
    - Last Modified: Wed Feb 28 13:53:47 GMT 2024
    - 5K bytes
    - Viewed (0)
  5. tensorflow/c/experimental/gradients/math_grad_test.cc

        ASSERT_NO_FATAL_FAILURE(CheckTensorValue(outputs[1], dB_vals[i],
                                                 /*dims*/ {3, 3},
                                                 /*abs_error*/ 0));
        outputs[0]->Unref();
        outputs[1]->Unref();
      }
    }
    
    TEST_P(CppGradients, TestSqrtGrad) {
      AbstractTensorHandlePtr x;
      {
        AbstractTensorHandle* x_raw = nullptr;
        status_ = TestScalarTensorHandle<float, TF_FLOAT>(
    C++
    - Registered: Tue Mar 26 12:39:09 GMT 2024
    - Last Modified: Thu Apr 13 17:32:14 GMT 2023
    - 16.3K bytes
    - Viewed (0)
  6. tensorflow/c/experimental/gradients/array_grad_test.cc

      // Although, `ops::IdentityN` returns 2 tensors, the first tensor isn't needed
      // for computing gradient so we could safely drop it.
      outputs[0] = temp_outputs[1];
      temp_outputs[0]->Unref();
      return absl::OkStatus();
    }
    
    class CppGradients
        : public ::testing::TestWithParam<std::tuple<const char*, bool, bool>> {
     protected:
      void SetUp() override {
        TF_StatusPtr status(TF_NewStatus());
    C++
    - Registered: Tue Mar 26 12:39:09 GMT 2024
    - Last Modified: Wed Feb 28 13:53:47 GMT 2024
    - 5K bytes
    - Viewed (0)
  7. tensorflow/c/experimental/gradients/math_grad.cc

        return absl::OkStatus();
      }
      ~DivNoNanGradientFunction() override {
        for (auto input : forward_inputs_) {
          if (input) {
            input->Unref();
          }
        }
        for (auto output : forward_outputs_) {
          if (output) {
            output->Unref();
          }
        }
      }
    
     private:
      // TODO(b/174778737): Only hold needed inputs and outputs.
      vector<AbstractTensorHandle*> forward_inputs_;
    C++
    - Registered: Tue Mar 26 12:39:09 GMT 2024
    - Last Modified: Wed Feb 28 13:53:47 GMT 2024
    - 15.2K bytes
    - Viewed (0)
  8. tensorflow/c/eager/c_api_unified_experimental.cc

      return wrap((unwrap(c)->CreateOperation()));
    }
    
    void TF_DeleteAbstractOp(TF_AbstractOp* op) { unwrap(op)->Release(); }
    
    void TF_DeleteAbstractTensor(TF_AbstractTensor* t) { unwrap(t)->Unref(); }
    
    TF_OutputList* TF_NewOutputList() { return wrap(new OutputList); }
    void TF_DeleteOutputList(TF_OutputList* o) { delete unwrap(o); }
    void TF_OutputListSetNumOutputs(TF_OutputList* o, int num_outputs,
    C++
    - Registered: Tue Apr 23 12:39:09 GMT 2024
    - Last Modified: Thu Feb 15 09:49:45 GMT 2024
    - 9K bytes
    - Viewed (0)
  9. tensorflow/c/experimental/gradients/tape/tape_operation.cc

      // parent_op_->Ref();
    }
    void TapeOperation::Release() {
      // TODO(srbs): Change to Unref().
      delete this;
    }
    TapeOperation::~TapeOperation() {
      // TODO(b/172003047): Consider making AbstractOperation RefCounted.
      // parent_op->Unref();
    }
    Status TapeOperation::Reset(const char* op, const char* raw_device_name) {
      forward_op_.op_name = op;
      forward_op_.attrs.Reset(op);
    C++
    - Registered: Tue Feb 27 12:39:08 GMT 2024
    - Last Modified: Tue Jun 07 01:53:35 GMT 2022
    - 9K bytes
    - Viewed (1)
  10. tensorflow/c/experimental/gradients/nn_grad_test.cc

      // Although, `ops::SparseSoftmaxCrossEntropyWithLogits` returns 2 tensors, the
      // second tensor isn't needed for computing gradient so we could safely drop
      // it.
      outputs[0] = loss;
      backprop->Unref();
      return absl::OkStatus();
    }
    
    Status BiasAddModel(AbstractContext* ctx,
                        absl::Span<AbstractTensorHandle* const> inputs,
                        absl::Span<AbstractTensorHandle*> outputs) {
    C++
    - Registered: Tue Mar 26 12:39:09 GMT 2024
    - Last Modified: Wed Feb 28 13:53:47 GMT 2024
    - 8.3K bytes
    - Viewed (0)
Back to top