Tensor Comprehensions
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
tc::ATenCompilationUnit Class Reference

#include <aten_compiler.h>

Collaboration diagram for tc::ATenCompilationUnit:

Public Member Functions

 ATenCompilationUnit ()
 
void define (const std::string &language)
 
size_t compile (const std::string &name, const std::vector< at::Tensor > &inputs, const MappingOptions &options)
 Given a TC name, compile the TC. More...
 
std::vector< const DLTensor * > inferOutputTensorInfo (const std::string &name, const std::vector< at::Tensor > &inputs)
 Get the output Tensor info. More...
 
Duration run (const std::string &name, const std::vector< at::Tensor > &inputs, std::vector< at::Tensor > &outputs, size_t handle, bool profile=false)
 
void uncheckedRun (const std::vector< at::Tensor > &inputs, std::vector< at::Tensor > &outputs, size_t handle)
 

Private Attributes

std::unique_ptr< ExecutionEngineexecutionEngine_
 

Detailed Description

This provides the basic interface for writing ATen style tensor operations based on Tensor Comprehensions.

Constructor & Destructor Documentation

tc::ATenCompilationUnit::ATenCompilationUnit ( )
explicit

Member Function Documentation

size_t tc::ATenCompilationUnit::compile ( const std::string &  name,
const std::vector< at::Tensor > &  inputs,
const MappingOptions options 
)

Given a TC name, compile the TC.

void tc::ATenCompilationUnit::define ( const std::string &  language)

Define a database from input TC language where language can have many tc strings. This database is used to run any TC just by its name by passing it to the run function.

std::vector<const DLTensor*> tc::ATenCompilationUnit::inferOutputTensorInfo ( const std::string &  name,
const std::vector< at::Tensor > &  inputs 
)

Get the output Tensor info.

Duration tc::ATenCompilationUnit::run ( const std::string &  name,
const std::vector< at::Tensor > &  inputs,
std::vector< at::Tensor > &  outputs,
size_t  handle,
bool  profile = false 
)

Given a TC name, run the TC and fill the outputs vector the results if profile is set it returns the runtime in nanoseconds. Compilation must have already occured.

void tc::ATenCompilationUnit::uncheckedRun ( const std::vector< at::Tensor > &  inputs,
std::vector< at::Tensor > &  outputs,
size_t  handle 
)

This is the "low-latency" mode in which we just propagate ATen tensors Sizes are not checked and it is the user's responsibility to ensure that they match. If the user doesn't then segfault will likely occur.

Member Data Documentation

std::unique_ptr<ExecutionEngine> tc::ATenCompilationUnit::executionEngine_
private

The documentation for this class was generated from the following file: