Home / Class/ JIValue Class — pytorch Architecture

JIValue Class — pytorch Architecture

Architecture documentation for the JIValue class in pytorch_jni_common.h from the pytorch codebase.

Entity Profile

Relationship Graph

Source Code

android/pytorch_android/src/main/cpp/pytorch_jni_common.h lines 96–134

class JIValue : public facebook::jni::JavaClass<JIValue> {
  using DictCallback = c10::function_ref<facebook::jni::local_ref<JIValue>(
      c10::Dict<c10::IValue, c10::IValue>)>;

 public:
  constexpr static const char* kJavaDescriptor = "Lorg/pytorch/IValue;";

  constexpr static int kTypeCodeNull = 1;

  constexpr static int kTypeCodeTensor = 2;
  constexpr static int kTypeCodeBool = 3;
  constexpr static int kTypeCodeLong = 4;
  constexpr static int kTypeCodeDouble = 5;
  constexpr static int kTypeCodeString = 6;

  constexpr static int kTypeCodeTuple = 7;
  constexpr static int kTypeCodeBoolList = 8;
  constexpr static int kTypeCodeLongList = 9;
  constexpr static int kTypeCodeDoubleList = 10;
  constexpr static int kTypeCodeTensorList = 11;
  constexpr static int kTypeCodeList = 12;

  constexpr static int kTypeCodeDictStringKey = 13;
  constexpr static int kTypeCodeDictLongKey = 14;

  static facebook::jni::local_ref<JIValue> newJIValueFromAtIValue(
      const at::IValue& ivalue,
      DictCallback stringDictCallback = newJIValueFromStringDict,
      DictCallback intDictCallback = newJIValueFromIntDict);

  static at::IValue JIValueToAtIValue(
      facebook::jni::alias_ref<JIValue> jivalue);

 private:
  static facebook::jni::local_ref<JIValue> newJIValueFromStringDict(
      c10::Dict<c10::IValue, c10::IValue>);
  static facebook::jni::local_ref<JIValue> newJIValueFromIntDict(
      c10::Dict<c10::IValue, c10::IValue>);
};

Domain

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free