Skip to content

Instantly share code, notes, and snippets.

View monokabu_slack
github: koheihamada
slack: kohei.hamada
VadPinchuk / styles.xml
Created Feb 25, 2020
Launch and Normal styles
View styles.xml
<style name="LaunchTheme" parent="@android:style/ThemeOverlay.Material.Dark">
<item name="android:windowNoTitle">true</item>
<item name="android:windowBackground">@drawable/launch_background</item>
<item name="android:navigationBarColor">@color/brandGrey</item>
<style name="NormalTheme" parent="@android:style/ThemeOverlay.Material.Dark">
<item name="android:windowBackground">@drawable/normal_background</item>
View work.js
function add1(){
var newItem = document.createElement('li');
newItem.innerHTML = 'Lamborgini';
// var rem = myList.lastChild;
// console.log(rem)
// if(rem == activeElement ){
activeElement = newItem;
// }
View cr_5812_1582623088.diff
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index a808c1b53..d9c370d05 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -10495,15 +10495,10 @@ static int bgp_table_stats(struct vty *vty, struct bgp *bgp, afi_t afi,
safi_t safi, struct json_object *json);
-DEFUN (show_ip_bgp_statistics_all,
- show_ip_bgp_statistics_all_cmd,

A Tour of PyTorch Internals (Part I)

The fundamental unit in PyTorch is the Tensor. This post will serve as an overview for how we implement Tensors in PyTorch, such that the user can interact with it from the Python shell. In particular, we want to answer four main questions:

  1. How does PyTorch extend the Python interpreter to define a Tensor type that can be manipulated from Python code?
  2. How does PyTorch wrap the C libraries that actually define the Tensor's properties and methods?
  3. How does PyTorch cwrap work to generate code for Tensor methods?
  4. How does PyTorch's build system take all of these components to compile and generate a workable application?

Extending the Python Interpreter

PyTorch defines a new package torch. In this post we will consider the ._C module. This module is known as an "extension module" - a Python module written in C. Such modules allow us to define new built-in object types (e.g. the Tensor) and to call C/C++ functions.

You can’t perform that action at this time.