Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 11 for AbstractContext (0.1 sec)

  1. tensorflow/c/eager/abstract_context.h

    // Implementations of the context may contain some state e.g. an execution
    // environment, a traced representation etc.
    class AbstractContext {
     protected:
      enum AbstractContextKind { kGraph, kMlir, kEager, kTfrt, kTape, kOpHandler };
      explicit AbstractContext(AbstractContextKind kind) : kind_(kind) {}
      virtual ~AbstractContext() {}
    
     public:
      AbstractContextKind getKind() const { return kind_; }
    
    Registered: Tue Nov 05 12:39:12 UTC 2024
    - Last Modified: Sat Oct 12 05:11:17 UTC 2024
    - 3K bytes
    - Viewed (0)
  2. tensorflow/c/eager/gradient_checker_test.cc

    }
    
    absl::Status MatMulModel(AbstractContext* ctx,
                             absl::Span<AbstractTensorHandle* const> inputs,
                             absl::Span<AbstractTensorHandle*> outputs) {
      return ops::MatMul(ctx, inputs[0], inputs[1], &outputs[0],
                         /*transpose_a=*/false,
                         /*transpose_b=*/false, "MatMul");
    }
    
    absl::Status MulModel(AbstractContext* ctx,
    Registered: Tue Nov 05 12:39:12 UTC 2024
    - Last Modified: Sat Oct 12 05:11:17 UTC 2024
    - 6.5K bytes
    - Viewed (0)
  3. tensorflow/c/eager/c_api_unified_experimental_internal.h

    // This holds the context for the execution: dispatching operations either to an
    // MLIR implementation or to a graph implementation.
    class TracingContext : public AbstractContext {
     protected:
      explicit TracingContext(AbstractContextKind kind) : AbstractContext(kind) {}
    
     public:
      // Add a function parameter and return the corresponding tensor.
      virtual absl::Status AddParameter(DataType dtype,
    Registered: Tue Nov 05 12:39:12 UTC 2024
    - Last Modified: Sat Oct 12 05:11:17 UTC 2024
    - 5.2K bytes
    - Viewed (0)
  4. tensorflow/c/eager/immediate_execution_context.h

    // Abstract interface to a context.
    //
    // A context is responsible for creating key objects such as Tensors,
    // TensorHandles & Operations.
    class ImmediateExecutionContext : public AbstractContext {
     public:
      // Optimized scalar creation functions
      virtual AbstractTensorInterface* CreateInt64Scalar(int64_t value) = 0;
      virtual AbstractTensorInterface* CreateUint64Scalar(uint64 value) = 0;
    Registered: Tue Nov 05 12:39:12 UTC 2024
    - Last Modified: Sat Oct 12 05:11:17 UTC 2024
    - 12.3K bytes
    - Viewed (0)
  5. tensorflow/c/eager/gradient_checker.cc

      for (int i = 0; i < num_dims; i++) {
        out_dims[i] = TF_Dim(t, i);
      }
    }
    
    // Runs model as is if output is a scalar,
    // else sums the output tensor before returning.
    absl::Status RunAndMaybeSum(AbstractContext* ctx, Model forward,
                                absl::Span<AbstractTensorHandle* const> inputs,
                                absl::Span<AbstractTensorHandle*> outputs,
                                bool use_function) {
    Registered: Tue Nov 05 12:39:12 UTC 2024
    - Last Modified: Sat Oct 12 05:11:17 UTC 2024
    - 7.3K bytes
    - Viewed (0)
  6. tensorflow/c/eager/gradients_test.cc

    }
    
    TEST_P(CppGradients, TestSetAttrString) {
      std::unique_ptr<TF_Status, decltype(&TF_DeleteStatus)> status(
          TF_NewStatus(), TF_DeleteStatus);
      AbstractContextPtr ctx;
      {
        AbstractContext* ctx_raw = nullptr;
        absl::Status s =
            BuildImmediateExecutionContext(std::get<1>(GetParam()), &ctx_raw);
        ASSERT_EQ(errors::OK, s.code()) << s.message();
        ctx.reset(ctx_raw);
      }
    
    Registered: Tue Nov 05 12:39:12 UTC 2024
    - Last Modified: Sat Oct 12 05:11:17 UTC 2024
    - 7K bytes
    - Viewed (0)
  7. tensorflow/c/eager/gradients.h

    // }
    //
    // Status RegisterGradients(GradientRegistry* registry) {
    //   return registry->Register("Add", AddRegisterer);
    // }
    class GradientFunction {
     public:
      virtual absl::Status Compute(
          AbstractContext* ctx,
          absl::Span<AbstractTensorHandle* const> grad_outputs,
          absl::Span<AbstractTensorHandle*> grad_inputs) = 0;
      virtual ~GradientFunction() {}
    };
    
    Registered: Tue Nov 05 12:39:12 UTC 2024
    - Last Modified: Sat Oct 12 05:11:17 UTC 2024
    - 6.9K bytes
    - Viewed (0)
  8. tensorflow/c/eager/gradients.cc

    // tensor.
    int64_t ToId(const AbstractTensorHandle* t) {
      return static_cast<int64_t>(reinterpret_cast<uintptr_t>(t));
    }
    
    absl::Status ZerosLike(AbstractContext* ctx, AbstractTensorHandle* t,
                           AbstractTensorHandle** result) {
      AbstractOperationPtr op(ctx->CreateOperation());
      TF_RETURN_IF_ERROR(op->Reset("ZerosLike", /*raw_device_name=*/nullptr));
    Registered: Tue Nov 05 12:39:12 UTC 2024
    - Last Modified: Sat Oct 12 05:11:17 UTC 2024
    - 19.7K bytes
    - Viewed (0)
  9. tensorflow/c/eager/gradients_internal.h

                                     absl::Span<const AbstractOperation*> values,
                                     ForwardOperation*);
    
    // Make the call to `Tape::RecordOperation`.
    absl::Status Execute(AbstractOperation*, AbstractContext*,
                         absl::Span<AbstractTensorHandle*> retvals,
                         int* num_retvals, ForwardOperation*, Tape*,
                         const GradientRegistry&);
    
    }  // namespace internal
    Registered: Tue Nov 05 12:39:12 UTC 2024
    - Last Modified: Sat Oct 12 05:11:17 UTC 2024
    - 4.7K bytes
    - Viewed (0)
  10. tensorflow/c/eager/gradient_checker.h

     *
     * `numerical_grad` is the pointer to the AbstractTensorHandle* which will
     * hold the numerical gradient data at the end of the function.
     */
    absl::Status CalcNumericalGrad(AbstractContext* ctx, Model forward,
                                   absl::Span<AbstractTensorHandle* const> inputs,
                                   int input_index, bool use_function,
    Registered: Tue Nov 05 12:39:12 UTC 2024
    - Last Modified: Sat Oct 12 05:11:17 UTC 2024
    - 1.8K bytes
    - Viewed (0)
Back to top