Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 12 for TaggedValue (0.32 sec)

  1. tensorflow/cc/experimental/libtf/function.h

                                       TaggedValue input_signature,
                                       TaggedValue output_signature);
    
      // Executes this function under the execution context.
      //
      // Raises an error is no matching signature is found for TaggedValue.
      tensorflow::StatusOr<TaggedValue> Execute(tensorflow::AbstractContext*,
                                                TaggedValue) const;
    
     private:
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Aug 30 21:44:45 UTC 2022
    - 1.9K bytes
    - Viewed (0)
  2. tensorflow/cc/experimental/libtf/tests/tensor_test.cc

        ASSERT_FALSE(x->RefCountIsOne());
      }
      ASSERT_TRUE(x->RefCountIsOne());
    }
    
    TaggedValue MakeScalarTensor(TaggedValue self, TaggedValue val) {
      if (val.type() != TaggedValue::FLOAT32) return TaggedValue::None();
      if (self.type() != TaggedValue::DICT) return TaggedValue::None();
      TaggedValue ctx_capsule = (self.dict())[TaggedValue("context")];
      AbstractContext* ctx = static_cast<AbstractContext*>(ctx_capsule.capsule());
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri May 19 21:44:52 UTC 2023
    - 5K bytes
    - Viewed (0)
  3. tensorflow/cc/experimental/libtf/function.cc

      return call_op->Execute(outputs, &num_outputs);
    }
    
    Status VerifySupportedSignature(TaggedValue signature) {
      if (signature.type() == TaggedValue::Type::TENSOR_SPEC) {
        return ::tensorflow::OkStatus();
      }
      if (signature.type() == TaggedValue::Type::TUPLE) {
        for (const auto& t : signature.tuple()) {
          if (t.type() != TaggedValue::Type::TENSOR_SPEC) {
            break;
          }
        }
        return ::tensorflow::OkStatus();
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Mon Mar 04 19:49:06 UTC 2024
    - 9.1K bytes
    - Viewed (0)
  4. tensorflow/cc/experimental/libtf/tests/value_test.cc

    }
    
    TEST(Test1, TestDict) {
      TaggedValue s1("test1");
      TaggedValue s2("test2");
      TaggedValue d = TaggedValue::Dict();
      d.dict()[s2] = TaggedValue(6.f);
      std::stringstream stream;
      stream << d;
      ASSERT_EQ(stream.str(), "{test2: 6, }");
    }
    
    namespace {
    TaggedValue add(TaggedValue args, TaggedValue kwargs) {
      if (args.type() == TaggedValue::TUPLE) {
        return TaggedValue(args.tuple()[0].f32() + args.tuple()[1].f32());
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Sep 01 11:18:25 UTC 2022
    - 3.4K bytes
    - Viewed (0)
  5. tensorflow/cc/experimental/libtf/runtime/runtime.cc

    using tensorflow::tracing::graph::GraphFunction;
    
    TaggedValue MakeCallable(const std::string& fn_name, Function fn,
                             AbstractContext* ctx) {
      auto CallFn = [fn_name, fn, ctx](TaggedValue args_,
                                       TaggedValue kwargs_) -> TaggedValue {
        std::cout << "Calling " << fn_name << std::endl;
        tensorflow::StatusOr<TaggedValue> v = fn.Execute(ctx, args_);
        return v.value();
      };
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Sep 01 11:18:25 UTC 2022
    - 7.4K bytes
    - Viewed (0)
  6. tensorflow/cc/experimental/libtf/tests/perf_test.cc

    #include "tensorflow/core/platform/test.h"
    #include "tensorflow/core/platform/test_benchmark.h"
    
    namespace tf {
    namespace libtf {
    
    namespace {
    
    // AddTagged using tagged values
    TaggedValue AddTagged(TaggedValue args, TaggedValue kwargs) {
      return TaggedValue(args.tuple()[0].i64() + args.tuple()[1].i64());
    }
    
    int64_t AddRaw(int64_t a, int64_t b) { return a + b; }
    
    }  // namespace
    
    // Add numbers in a loop by calling a callable.
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Jul 15 16:58:38 UTC 2021
    - 3K bytes
    - Viewed (0)
  7. tensorflow/cc/experimental/libtf/mlir/mlir_transform.cc

        return None();
      }
    
      // Make a module to wrap MLIR module and allow getting strings and running
      // transforms.
      // auto obj = TaggedValue::Dict();
      Object obj;
      obj.Set(
          String("_module"),
          Handle(impl::TaggedValue::Capsule(new mlir::OwningOpRef<mlir::ModuleOp>(
              std::move(module_or).value()))));
    
      auto get_string = [](Object self) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Jul 12 16:28:19 UTC 2022
    - 3K bytes
    - Viewed (0)
  8. tensorflow/cc/experimental/libtf/tests/object_test.cc

      EXPECT_EQ(l.size(), 1);
    }
    
    TaggedValue AddIntegers(TaggedValue args_, TaggedValue kwargs_) {
      auto& args = args_.tuple();
      // auto& kwargs = kwargs_.dict();
      return TaggedValue(args[0].i64() + args[1].i64());
    }
    
    TEST(ObjectTest, TestCast) {
      Integer i(3);
      auto result = Cast<String>(i);
      ASSERT_TRUE(!result.ok());
    }
    
    TEST(ObjectTest, TestCall) {
      TaggedValue add_func(AddIntegers);
      Callable add(add_func);
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed Jul 28 21:37:07 UTC 2021
    - 5.7K bytes
    - Viewed (0)
  9. tensorflow/cc/experimental/libtf/tests/visit_test.cc

      const char* operator()(Float32 f) { return "float32"; }
      template <class T>
      const char* operator()(const T& i) {
        return "else";
      }
    };
    
    TEST(VisitTest, Test1) {
      TaggedValue a(Int64(1)), b(Float32(1.1f));
      TaggedValue c = TaggedValue::None();
    
      ASSERT_EQ(a.visit<const char*>(Visitor()), "int64");
      ASSERT_EQ(b.visit<const char*>(Visitor()), "float32");
      ASSERT_EQ(c.visit<const char*>(Visitor()), "else");
    }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Jul 15 16:58:38 UTC 2021
    - 1.4K bytes
    - Viewed (0)
  10. tensorflow/cc/experimental/libtf/runtime/core/core.cc

    #include "tensorflow/cc/experimental/libtf/value.h"
    
    namespace tf {
    namespace libtf {
    namespace runtime {
    namespace core {
    
    runtime::Runtime Runtime() {
      TaggedValue ctx_capsule;
      TFE_Context* ctx;
      TFE_ContextOptions* ctx_options = TFE_NewContextOptions();
      TFE_ContextOptionsSetDevicePlacementPolicy(ctx_options,
                                                 TFE_DEVICE_PLACEMENT_WARN);
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Jul 15 16:58:38 UTC 2021
    - 1.6K bytes
    - Viewed (0)
Back to top