This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
import torch.multiprocessing as mp | |
from absl import app, flags | |
from torchvision.models import AlexNet | |
FLAGS = flags.FLAGS | |
flags.DEFINE_integer("num_processes", 2, "Number of subprocesses to use") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Compile with: | |
// $ clang++ cstr.cpp -o cstr.so -std=c++1z -O0 -g -shared -fPIC -std=c++1z | |
//---------------------------------------------------- | |
#include <iostream> | |
#include <string> | |
#include <sstream> | |
#include <cstring> // std::strncpy | |
#include <cmath> | |
#if defined(_WIN32) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.spark.SparkContext | |
import org.apache.spark.sql.expressions.{MutableAggregationBuffer, UserDefinedAggregateFunction} | |
import org.apache.spark.sql.types._ | |
import org.apache.spark.sql.{Column, Row, SQLContext} | |
/*** | |
* UDAF combining maps, overriding any duplicate key with "latest" value | |
* @param keyType DataType of Map key | |
* @param valueType DataType of Value key | |
* @param merge function to merge values of identical keys |