c10::Scalar Class Reference

Scalar represents a 0-dimensional tensor which contains a single element. More...

`#include <Scalar.h>`

## Public Member Functions | |

template<typename T > | |

T | to () |

bool | isFloatingPoint () const |

bool | isIntegral () const |

bool | isComplex () const |

Scalar | operator- () const |

Scalar represents a 0-dimensional tensor which contains a single element.

Unlike a tensor, numeric literals (in C++) are implicitly convertible to Scalar (which is why, for example, we provide both add(Tensor) and add(Scalar) overloads for many operations). It may also be used in circumstances where you statically know a tensor is 0-dim and single size, but don't know it's type.

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

- c10/core/Scalar.h
- c10/core/Scalar.cpp

Generated on Thu Mar 21 2019 13:06:25 for Caffe2 - C++ API by 1.8.11