목록 분류 전체보기 (299)
"CODE" ///op_kernel.cc :: Kernel registration struct KernelRegistration { KernelRegistration(const KernelDef& d, StringPiece c, kernel_factory::OpKernelRegistrar::Factory f) : def(d), kernel_class_name(std::string(c)), factory(f) {} const KernelDef def; const string kernel_class_name; const kernel_factory::OpKernelRegistrar::Factory factory; }; // This maps from 'op_type' + DeviceType to the set..
"CODE" ///// tensorflow/core/kernels/training_ops.cc #define REGISTER_KERNELS(T, Tindices) \ REGISTER_KERNEL_BUILDER(Name("SparseApplyProximalAdagrad") \ .Device(DEVICE_CPU) \ .TypeConstraint("T") \ .TypeConstraint("Tindices"), \ SparseApplyProximalAdagradOp); \ REGISTER_KERNEL_BUILDER(Name("ResourceSparseApplyProximalAdagrad") \ .Device(DEVICE_CPU) \ .TypeConstraint("T") \ .TypeConstraint("Tind..
std::initializer_list cppreference_ std::initializer_list Stackoverflow _The constructor initializer list and const variable initializer list className (parameter) : varName1(arg), varName2(arg) {}; - 위의 형식으로 생성자를 정의하는 것으로 생성과 동시에 멤버 변수를 초기화 하고, 이를 생성자 리스트라고 한다. #include using namespace std; class myclass { int integer; char character; public: myclass(): integer(10), character('A'){};// construc..
ctags / cscope - ctags와 cscope를 이용하여 코드를 분석하는 방법과 유용했던 팁을 정리하였다. ctags - tj 명령어 뒤에 원하는 태그 이름을 입력하는 것으로 해당 함수나 변수가 선언된 위치로 점프할 수 있다. :tj "tags" - 명령어를 이용하지 않고 원하는 함수나 변수 위에 커서를 두고 점프하고 이전으로 돌아갈 수 있다. ctrl + ] ctrl + t cscope - cs type option keyword로 실행한다. type은 add / find / help / kill / reset / show 가 있고, find(f)와 아래 옵션을 통해 키워드를 검색한다. cscope commands[f] g : find the definitions s : search this ..
scope resolution operator stackoverflow_ C++ : what is :: for? namespace - 복수개의 header를 사용할 때, header 안 멤버가 중복될 경우를 방지하기 위해 공간을 마련. 같은 이름의 함수 print가 A.h / B.h에서 정의된다고 가정할 때 아래와 같은 방식으로 혼란을 피한다. sol1) Scope resolution operator int main(void){ A::print(); B::print(); } sol2) namespace using namespace A; int main(void){ print(); B::print(); }
ctags / cscope - 리눅스에서 길고 복잡한 코드를 다룰때 유용한 유틸리티 두가지. ctags - 소스 코드의 태그(변수, 함수, 매크로 등의 선언 부분)들의 데이터 베이스 파일을 생성해 인덱스를 만들어 주어, 코드 분석 시 탐색할 수 있도록 하는 유틸리티이다. sudo apt-get install ctags - tags 파일을 생성하여 소스 코드의 태그를 데이터 베이스로 관리할 수 있다. ctags "Filename" ctags -R - 위 두 명령어처럼 ctags 다음에 파일 이름을 명시하는 것으로 해당 파일만 tags 파일을 만들거나, 아래 ctags -R처럼 현재 디렉토리의 모든 파일/ 하위 디렉토리의 모든 파일을 대상으로 tags 파일을 만들 수 있다. - vi 에디터에 tags 파일 ..
Using GPU - tensorflow는 CPU와 GPU를 사용하여 연산을 처리할 수 있다고 공부하였다. 이번에는 tensorflow에서 연산 장치를 결정하는 방법을 공부했다. - tensorflow_ using gpu / 텐서플로우 블로그 - 6. 병렬 처리를 참고하였다. Supported device - tensorflow는 device type을 다음처럼 string으로 표시한다. "/cpu:0": The CPU of your machine. "/device:GPU:0": The GPU of your machine, if you have one. "/device:GPU:1": The second GPU of your machine, etc. - 현재 사용중인 디바이스를 확인하고자 할때는 log_d..
Architecture - tensorflow architecture를 tensorflow docs _ architecture와 [생각의 웹] 텐서플로우 소스 구조 분석 (TensorFlow Internal)를 참고하여 공부하였다. Overview Client : Defines dataflow graph / Initiates session C API : Separates user level code in different languages from core runtime Distributed Master : Prunes graph / Distributes them to worker services Worker Services : Schedule to appropriate to the available h..