Example #1
0
LuaPrimitiveObject append(const thpp::Tensor<T>& val, LuaRefList& refs,
                          thpp::SharingMode sharing) {
  LuaRefObject ref;
  ref.__isset.tensorVal = true;
  val.serialize(ref.tensorVal, thpp::ThriftTensorEndianness::NATIVE, sharing);

  return appendRef(std::move(ref), refs);
}
Example #2
0
LuaObject make(thpp::Tensor<T>& val) {
  LuaRefObject ref;
  ref.__isset.tensorVal = true;
  val.serialize(ref.tensorVal);

  LuaObject obj;
  obj.refs.push_back(std::move(ref));
  obj.value.__isset.refVal = true;
  obj.value.refVal = 0;
  return obj;
}