30 #include <unordered_map> 44 class TensorListMap :
public std::unordered_map<std::string, core::TensorList> {
48 :
std::unordered_map<
std::string, core::TensorList>(),
49 primary_key_(primary_key) {}
53 const std::unordered_map<std::string, core::TensorList>&
54 map_keys_to_tensorlists)
55 :
std::unordered_map<
std::string, core::TensorList>(),
56 primary_key_(primary_key) {
57 Assign(map_keys_to_tensorlists);
73 void Assign(
const std::unordered_map<std::string, core::TensorList>&
74 map_keys_to_tensorlists);
83 const std::unordered_map<std::string, core::Tensor>&
105 void AssertTensorMapSameKeys(
106 const std::unordered_map<std::string, core::Tensor>&
107 map_keys_to_tensors)
const;
114 void AssertTensorMapSameDevice(
115 const std::unordered_map<std::string, core::Tensor>&
116 map_keys_to_tensors)
const;
119 int64_t GetPrimarySize()
const {
return at(primary_key_).GetSize(); }
123 return at(primary_key_).GetDevice();
129 std::string primary_key_;
void SynchronizedPushBack(const std::unordered_map< std::string, core::Tensor > &map_keys_to_tensors)
Definition: TensorListMap.cpp:89
bool IsSizeSynchronized() const
Returns true if all tensorlists in the map have the same size.
Definition: TensorListMap.cpp:64
std::string GetPrimaryKey() const
Returns the primary key of the tensorlistmap.
Definition: TensorListMap.h:87
TensorListMap()
Definition: TensorListMap.h:63
void Assign(const std::unordered_map< std::string, core::TensorList > &map_keys_to_tensorlists)
Definition: TensorListMap.cpp:41
void AssertSizeSynchronized() const
Assert IsSizeSynchronized().
Definition: TensorListMap.cpp:73
void LogError(const char *format, const Args &... args)
Definition: Console.h:176
Definition: Optional.h:922
TensorListMap(const std::string &primary_key)
Create empty TensorListMap and set primary key.
Definition: TensorListMap.h:47
Definition: TensorListMap.h:44
int count
Definition: FilePCD.cpp:61
Definition: PinholeCameraIntrinsic.cpp:35
TensorListMap(const std::string &primary_key, const std::unordered_map< std::string, core::TensorList > &map_keys_to_tensorlists)
Create TensorListMap with pre-populated values.
Definition: TensorListMap.h:52
bool Contains(const std::string &key) const
Definition: TensorListMap.h:97