Module caffe2.python.schema. More...
Classes | |
| class | _SchemaNode |
| class | Field |
| class | List |
| class | Metadata |
| class | Scalar |
| class | Struct |
Functions | |
| def | Map (keys, values, keys_name='keys', values_name='values', lengths_blob=None) |
| def | NamedTuple (name_prefix, fields) |
| def | Tuple (fields) |
| def | RawTuple (num_fields, name_prefix='field') |
| def | from_dtype (dtype, _outer_shape=()) |
| def | from_column_list (col_names, col_types=None, col_blobs=None, col_metadata=None) |
| def | from_blob_list (schema, values) |
| def | as_record (value) |
| def | FetchRecord (blob_record, ws=None) |
| def | FeedRecord (blob_record, arrays, ws=None) |
| def | NewRecord (net, schema) |
| def | ConstRecord (net, array_record) |
| def | InitEmptyRecord (net, schema_or_record, enforce_types=False) |
| def | is_schema_subset (schema, original_schema) |
| def | equal_schemas (schema, original_schema) |
| def | schema_check (schema, previous=None) |
| def | data_type_for_dtype (dtype) |
| def | attach_metadata_to_scalars (field, metadata) |
Variables | |
| logger = logging.getLogger(__name__) | |
| string | FIELD_SEPARATOR = ':' |
| FeatureSpec | |
Module caffe2.python.schema.
| def schema.ConstRecord | ( | net, | |
| array_record | |||
| ) |
| def schema.FeedRecord | ( | blob_record, | |
| arrays, | |||
ws = None |
|||
| ) |
| def schema.FetchRecord | ( | blob_record, | |
ws = None |
|||
| ) |
| def schema.from_blob_list | ( | schema, | |
| values | |||
| ) |
| def schema.from_column_list | ( | col_names, | |
col_types = None, |
|||
col_blobs = None, |
|||
col_metadata = None |
|||
| ) |
| def schema.from_dtype | ( | dtype, | |
_outer_shape = () |
|||
| ) |
Constructs a Caffe2 schema from the given numpy's dtype. Numpy supports scalar, array-like and structured datatypes, as long as all the shapes are fixed. This function breaks down the given dtype into a Caffe2 schema containing `Struct` and `Scalar` types. Fields containing byte offsets are not currently supported.
| def schema.Map | ( | keys, | |
| values, | |||
keys_name = 'keys', |
|||
values_name = 'values', |
|||
lengths_blob = None |
|||
| ) |
| def schema.NewRecord | ( | net, | |
| schema | |||
| ) |
Given a record of np.arrays, create a BlobReference for each one of them, returning a record containing BlobReferences. The name of each returned blob is NextScopedBlob(field_name), which guarantees unique name in the current net. Use NameScope explicitly to avoid name conflictions between different nets.
| def schema.RawTuple | ( | num_fields, | |
name_prefix = 'field' |
|||
| ) |
| def schema.Tuple | ( | fields | ) |
1.8.14