taichi.lang.type_factory_impl

Module Contents

Classes

TypeFactory

A Python-side TypeFactory wrapper.

Attributes

type_factory

class taichi.lang.type_factory_impl.TypeFactory

A Python-side TypeFactory wrapper.

custom_int(self, bits, signed=True, compute_type=None)

Generates a custom int type.

Parameters
  • bits (int) – Number of bits.

  • signed (bool) – Signed or unsigned.

  • compute_type (DataType) – Type for computation.

Returns

The specified type.

Return type

DataType

custom_float(self, significand_type, exponent_type=None, compute_type=None, scale=1.0)

Generates a custom float type.

Parameters
  • significand_type (DataType) – Type of significand.

  • exponent_type (DataType) – Type of exponent.

  • compute_type (DataType) – Type for computation.

  • scale (float) – Scaling factor.

Returns

The specified type.

Return type

DataType

taichi.lang.type_factory_impl.type_factory