목록Machine Learning (38)
ecsimsw
///"tensorflow/core/framework/op_kernel.cc" typedef std::unordered_multimap KernelRegistry; void* GlobalKernelRegistry() { static KernelRegistry* global_kernel_registry = new KernelRegistry; return global_kernel_registry; } static KernelRegistry* GlobalKernelRegistryTyped() { return reinterpret_cast(GlobalKernelRegistry()); } /// Conclusion KernelRegistry : Unordered multi_map , includes key, ke..
///"tensorflow/core/framework/op_kernel.cc" // TODO(mrry): Convert to std::make_unique when available. OpKernel::OpKernel(OpKernelConstruction* context) : OpKernel(context, std::unique_ptr(new NodeDef(context->def()))) {} OpKernel::OpKernel(OpKernelConstruction* context, std::unique_ptr node_def) : def_(std::move(node_def)), input_types_(context->input_types().begin(), context->input_types().end..
///"tensorflow/core/framework/op_kernel.h" class OpKernelConstruction { public: OpKernelConstruction(DeviceType device_type, DeviceBase* device, Allocator* allocator, const NodeDef* node_def,const OpDef* op_def, FunctionLibraryRuntime* flib, const DataTypeSlice& input_types, const MemoryTypeSlice& input_memory_types, const DataTypeSlice& output_types, const MemoryTypeSlice& output_memory_types, ..
"CODE" ///"tensorflow/core/platform/file_system.h" class FileSystemRegistry { public: typedef std::function Factory; virtual ~FileSystemRegistry(); virtual Status Register(const string& scheme, Factory factory) = 0; virtual FileSystem* Lookup(const string& scheme) = 0; virtual Status GetRegisteredFileSystemSchemes( std::vector* schemes) = 0; }; /// tensorflow/core/framework/op_kernel.h namespace..
"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..
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..