Template Metaprogramming: Type Traits## CppCon 2020 Template Metaprogramming: Type Traits Part 1 Jody Hagins jhagins@maystreet.com coachhagins@gmail.com ## CppCon 2020 Template Metaprogramming: Type Traits Introduction ## I ntended Audience oriented: shallow depth, slow current - Not necessarily beginner to C++, but beginner to traditional template metaprogramming techniques ## I ntended Audience • Beginner/Intermediate • Gentle entry: swimming oriented: shallow depth, slow current - Not necessarily beginner to C++, but beginner to traditional template metaprogramming techniques • Type traits part of standard library for ~10 years ## I ntended Audience0 码力 | 403 页 | 5.30 MB | 1 年前3
Template-Less Meta-Programming## Template-Less MetaProgramming 0 ## +24 ## KRIS JUSIAK 2024 September 15 - 20 ## Template Metaprogramming (TMP) templateusing meta_fun = this_talk ## static_assert(Template::Metaprogramming::is_hard); // ✓ ?static_assert(Template::Metaprogramming::is_hard); // ✓ ?static_assert(Template::Metaprogramming::is_powerful); // ✓ ?static_assert(Template::Metapr // ✓ ?static_assert(Template::Metaprogramming::is_powerful); // ✓ ?static_assert(( Template::Metaprogramming::is_easy and Template::Metaprogramming::is_powerful and Template::Metaprogramming::has; 0 码力 | 130 页 | 5.79 MB | 1 年前3
Django 2.2.x Documentation. . . . . . . . . . . . . 2 1.4 The model layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.5 The view layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.6 The template layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.7 Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 589 4.5 Custom template tags and filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 595 40 码力 | 2060 页 | 7.23 MB | 2 年前3
LSTM-Layer使用Default: 1 ### LSTM.forward() - out, (ht, ct) = lstm(x, [ht_1, ct_1]) x: [seq, b, vec] h/c: [num_layer, b, h] out: [seq, b, h] ## ☐ ☐ ☐ 1 lstm = nn.LSTM(input_size=100, hidden_size=20, num_layers=4) LSTMCell.forward() ■ ht, ct = lstmcell(xt, [ht_1, ct_1]) xt: [b, vec] - ht/ct: [b, h] print('one layer lstm') cell = nn.LSTMCell(input_size=100, hidden_size=20) h = torch.zeros(3, 20) c = torch shape, c.shape) torch.Size([3, 20]) torch.Size([3, 20]) ## Single layer ## ☀️ ☁️ ☁️ ## Two Layers ## ☐ ☐ ☐ print('two layer lstm') cell1 = nn.LSTMCell(input_size=100, hidden_size=30) cell20 码力 | 11 页 | 643.79 KB | 2 年前3
RNN-Layer使用## PyTorch ## RNN Layer使用 主讲人:龙良曲 ## Folded model [batch, feature len]@[hidden len, feature len] $ ^{T} $ +[batch, hidden len]@[hidden len, hidden len] $ ^{T} $ [0,0,0 ... ] $$ x_{t}@w_{xh} + h_{t}@w_{hh} h0) x: [seq len, b, word vec] h0/ht: [num layers, b, h dim] out: [seq len, b, h dim] ## Single layer RNN ## ☐ ☐ ☐ rnn = nn.RNN(input_size=100, hidden_size=20, num_layers=1) print(rnn) x = torch.randn(10 h_{t}^{2}@w_{hh}^{2} $$ [0,0,0 ... ] $$ x_{t}@w_{xh}^{1} + h_{t}^{1}@w_{hh}^{1} $$ feature ## 2 layer RNN ## ☐ ☐ ☐ In [17]: rnn=nn.RNN(100, 10, num_layers=2) In [18]: rnn.__parameters.keys() Out[18]:0 码力 | 15 页 | 883.60 KB | 2 年前3
Django 5.1.2 DocumentationGetting help 1 1.3 How the documentation is organized 2 1.4 The model layer 2 1.5 The view layer 2 1.6 The template layer 3 1.7 Forms 3 1.8 The development process 3 1.9 The admin 4 1.10 777 4.5 How to write custom lookups 792 4.6 How to implement a custom template backend 798 4.7 How to create custom template tags and filters 802 4.8 How to write a custom storage class 823 4.9 than tutorials and assume some knowledge of how Django works. ### 1.4 The model layer Django provides an abstraction layer (the “models”) for structuring and manipulating the data of your web application0 码力 | 2923 页 | 9.62 MB | 1 年前3
CakePHP Cookbook 4.x
CakePHP at a Glance • Conventions Over Configuration • The Model Layer • The View Layer • The Controller Layer • CakePHP Request Cycle • Just the Start • Additional Create the Article List Template • Create the View Action • Create the View Template • Adding Articles • Create Add Template • Adding Adding Simple Slug Generation • Add Edit Action • Create Edit Template • Update Validation Rules for Articles • Add Delete Action • Migration Guides0 码力 | 1249 页 | 1.04 MB | 2 年前3
Back to Basics: C++ Templates - Part 2## V ariadic templates: Parameter pack ## ■ Syntax: A typename|class... Ts generates a type template parameter pack with optional name. B Args... ts a function argument parameter pack with optional D ts... in the body of a function to unpack the arguments. 1 templatetemplate="" 4="" constexpr="" auto="" 5="" min(const="" t&="" a,="" const="" std::string(t); } 5 Catch all others and apply to_string 6 template auto Normalize(const T& t) { return std::to_string(t); } 7 template auto _StrCat(std::string& 0 码力 | 12 页 | 787.22 KB | 1 年前3
Apache ShardingSphere 5.0.0 Document15 3.4.3 Goal ..... 15 3.4.4 Implementation ..... 16 L1 Kernel Layer ..... 16 L2 Feature Layer ..... 16 L3 Ecosystem Layer ..... 17 Features ..... 18 4.1 DB Compatibility ..... 18 4.1.1 above multi-model databases. It focuses on how to reuse existing databases and their respective upper layer, rather than creating a new database. The concepts at the core of the project are Link, Enhance and ShardingSphere-JDBC defines itself as a lightweight Java framework that provides extra services at the Java JDBC layer. With the client end connecting directly to the database, it provides services in the form of a jar0 码力 | 403 页 | 3.15 MB | 2 年前3
Django 5.0.x Documentation• Write views that actually do something • Raising a 404 error • Use the template system • Removing hardcoded URLs in templates • Namespacing URL names classes Working with form templates Further topics Templates - The Django template language - Support for template engines Class-based views - Introduction to class-based views - Built-in Django's cache framework - Setting up the cache - The per-site cache - The per-view cache - Template fragment caching - The low-level cache API - Asynchronous support - Downstream caches - Using0 码力 | 3407 页 | 3.21 MB | 2 年前3
共 1000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 100
相关搜索词
metaprogramming techniquestype traitsspecializationprimary templatemetafunctionsTemplate Metaprogrammingboost.mp11Circle-langvalue-based metaprogrammingcompile timeDjango documentationmodel layerview layertemplate layerformsLSTMLSTM层门控机制PyTorch隐藏状态RNN Layernn.RNNhidden stateRNNCell序列长度Djangodevelopment processmiddlewareCakePHPMigration GuideController LayerModel LayerORMvariadic templatesfold expressionstemplate template parametersvariable templatesSFINAEPluggable ArchitectureLinkEnhanceL1 Kernel LayerL2 Feature Layeradmintemplateform













