• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/* Copyright 2021 The TensorFlow Authors. All Rights Reserved.
2
3Licensed under the Apache License, Version 2.0 (the "License");
4you may not use this file except in compliance with the License.
5You may obtain a copy of the License at
6
7    http://www.apache.org/licenses/LICENSE-2.0
8
9Unless required by applicable law or agreed to in writing, software
10distributed under the License is distributed on an "AS IS" BASIS,
11WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12See the License for the specific language governing permissions and
13limitations under the License.
14==============================================================================*/
15
16#ifdef TFRT_FALLBACK_OPS
17#else
18#define TFRT_FALLBACK_OPS
19
20include "mlir/Interfaces/SideEffectInterfaces.td"
21
22def Fallback_Dialect : Dialect {
23  let name = "tfrt_fallback";
24
25  let description = [{
26    The TFRT Fallback Dialect.
27  }];
28
29  let cppNamespace = "::tfrt::fallback";
30
31  let emitAccessorPrefix = kEmitAccessorPrefix_Raw;
32}
33
34// This corresponds to tensorflow::Tensor.
35def TFTensorType : DialectType<Fallback_Dialect,
36    CPred<"$_self.isa<::tfrt::fallback::TFTensorType>()">, "!tfrt_fallback.tf_tensor type">,
37    BuildableType<"$_builder.getType<::tfrt::fallback::TFTensorType>()"> {
38  let description = [{
39    `!tfrt_fallback.tf_tensor type` represents a tensorflow::Tensor.
40  }];
41}
42
43// This corresponds to tensorflow::Allocator.
44def TFAllocatorType : DialectType<Fallback_Dialect,
45    CPred<"$_self.isa<::tfrt::fallback::TFAllocatorType>()">, "!tfrt_fallback.tf_allocator type">,
46    BuildableType<"$_builder.getType<::tfrt::fallback::TFAllocatorType>()"> {
47  let description = [{
48    `!tfrt_fallback.tf_tensor type` represents a tensorflow::Tensor.
49  }];
50}
51
52#endif
53