tvm
Loading...
Searching...
No Matches
op.h
Go to the documentation of this file.
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19
24#ifndef TVM_RELAX_OP_OP_H_
25#define TVM_RELAX_OP_OP_H_
26
27#include <tvm/relax/expr.h>
29
30namespace tvm {
31namespace relax {
32
35 ffi::String te_grad_name;
36 ffi::Map<ffi::String, Any> te_grad_kwargs;
37
38 static void RegisterReflection();
39 TVM_FFI_DECLARE_OBJECT_INFO_FINAL("relax.attrs.CallTIRWithGradAttrs", CallTIRWithGradAttrs,
40 AttrsNode);
41}; // struct CallTIRAttrs
42
52 ffi::Array<int64_t> inplace_indices;
53
54 static void RegisterReflection();
55 TVM_FFI_DECLARE_OBJECT_INFO_FINAL("relax.attrs.CallTIRInplaceAttrs", CallTIRInplaceAttrs,
56 AttrsNode);
57}; // struct CallTIRInplaceAttrs
58
68 ffi::Array<int64_t> inplace_indices;
69
70 static void RegisterReflection();
71 TVM_FFI_DECLARE_OBJECT_INFO_FINAL("relax.attrs.CallInplacePackedAttrs", CallInplacePackedAttrs,
72 AttrsNode);
73}; // struct CallInplacePackedAttrs
74
76struct ToVDeviceAttrs : public AttrsNode {
77 explicit ToVDeviceAttrs(VDevice value) : dst_vdevice(std::move(value)) {}
78 explicit ToVDeviceAttrs(ffi::UnsafeInit) : dst_vdevice(ffi::UnsafeInit{}) {}
80
81 static void RegisterReflection();
83}; // struct ToVDeviceAttrs
84
87 int32_t device_type;
88 int32_t index;
90
91 static void RegisterReflection();
93}; // struct HintOnDeviceAttrs
94
95} // namespace relax
96} // namespace tvm
97
98#endif // TVM_RELAX_OP_OP_H_
Base class of all attribute class.
Definition attrs.h:50
Managed reference to VDeviceNode.
Definition global_info.h:66
ffi::String MemoryScope
Abstract label for an area of memory.
Definition global_info.h:36
An object that builds and maintains block scope and StmtSref mapping for Dependence analysis.
Definition attr.h:23
Global information used by Relax.
Attributes used in call_inplace_packed.
Definition op.h:60
ffi::Array< int64_t > inplace_indices
Indices that describe which input corresponds to which output.
Definition op.h:68
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("relax.attrs.CallInplacePackedAttrs", CallInplacePackedAttrs, AttrsNode)
Attributes used in call_tir_inplace.
Definition op.h:44
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("relax.attrs.CallTIRInplaceAttrs", CallTIRInplaceAttrs, AttrsNode)
ffi::Array< int64_t > inplace_indices
Indices that describe which input corresponds to which output.
Definition op.h:52
Attributes used in call_tir_with_grad.
Definition op.h:34
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("relax.attrs.CallTIRWithGradAttrs", CallTIRWithGradAttrs, AttrsNode)
ffi::String te_grad_name
Definition op.h:35
ffi::Map< ffi::String, Any > te_grad_kwargs
Definition op.h:36
Attributes used in hint_on_device.
Definition op.h:86
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("relax.attrs.HintOnDeviceAttrs", HintOnDeviceAttrs, AttrsNode)
int32_t device_type
Definition op.h:87
MemoryScope memory_scope
Definition op.h:89
int32_t index
Definition op.h:88
Attributes used in to_vdevice.
Definition op.h:76
static void RegisterReflection()
VDevice dst_vdevice
Definition op.h:79
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("relax.attrs.ToVDeviceAttrs", ToVDeviceAttrs, AttrsNode)
ToVDeviceAttrs(ffi::UnsafeInit)
Definition op.h:78
ToVDeviceAttrs(VDevice value)
Definition op.h:77