Home
last modified time | relevance | path

Searched refs:program_shape (Results 1 – 25 of 42) sorted by relevance

12

/external/tensorflow/tensorflow/compiler/xla/
Dshape_test.cc143 ProgramShape program_shape; in TEST_F() local
144 *program_shape.add_parameters() = ShapeUtil::MakeShape(F32, {1, 2, 3}); in TEST_F()
145 *program_shape.add_parameters() = ShapeUtil::MakeTokenShape(); in TEST_F()
146 *program_shape.add_parameters() = ShapeUtil::MakeShape(S64, {}); in TEST_F()
147 *program_shape.add_parameters() = ShapeUtil::MakeTupleShape( in TEST_F()
152 *program_shape.mutable_result() = ShapeUtil::MakeShape(F32, {7}); in TEST_F()
154 program_shape.add_parameter_names("foo"); in TEST_F()
155 program_shape.add_parameter_names("bar"); in TEST_F()
156 program_shape.add_parameter_names("baz"); in TEST_F()
157 program_shape.add_parameter_names("qux qux"); in TEST_F()
[all …]
Dlayout_util.cc166 /* static */ void LayoutUtil::SetToDefaultLayout(ProgramShape* program_shape) { in SetToDefaultLayout() argument
167 for (auto& parameter_shape : *program_shape->mutable_parameters()) { in SetToDefaultLayout()
170 LayoutUtil::SetToDefaultLayout(program_shape->mutable_result()); in SetToDefaultLayout()
266 /* static */ void LayoutUtil::ClearLayout(ProgramShape* program_shape) { in ClearLayout() argument
267 for (auto& parameter_shape : *program_shape->mutable_parameters()) { in ClearLayout()
270 LayoutUtil::ClearLayout(program_shape->mutable_result()); in ClearLayout()
318 /* static */ bool LayoutUtil::HasLayout(const ProgramShape& program_shape) { in HasLayout() argument
319 for (auto& parameter_shape : program_shape.parameters()) { in HasLayout()
324 return LayoutUtil::HasLayout(program_shape.result()); in HasLayout()
Dlayout_util.h73 static void SetToDefaultLayout(ProgramShape* program_shape);
91 static void ClearLayout(ProgramShape* program_shape);
127 static bool HasLayout(const ProgramShape& program_shape);
Dshape_util.cc150 ProgramShape program_shape; in MakeProgramShape() local
152 *program_shape.add_parameters() = shape; in MakeProgramShape()
154 *program_shape.mutable_result() = std::move(result); in MakeProgramShape()
155 return program_shape; in MakeProgramShape()
477 /* static */ string ShapeUtil::HumanString(const ProgramShape& program_shape) { in HumanString() argument
479 for (auto& shape : program_shape.parameters()) { in HumanString()
481 parameters.push_back(StrCat(i < program_shape.parameter_names_size() in HumanString()
482 ? program_shape.parameter_names(i) in HumanString()
487 HumanString(program_shape.result())); in HumanString()
Dshape.cc219 std::ostream& operator<<(std::ostream& out, const ProgramShape& program_shape) { in operator <<() argument
220 out << program_shape.ToString() << "\n"; in operator <<()
/external/tensorflow/tensorflow/compiler/xla/service/
Dcomputation_layout.cc26 ComputationLayout::ComputationLayout(const ProgramShape& program_shape, in ComputationLayout() argument
28 : result_layout_(program_shape.result()) { in ComputationLayout()
29 for (auto& shape : program_shape.parameters()) { in ComputationLayout()
60 ProgramShape program_shape; in ComputeProgramShape() local
62 *program_shape.add_parameters() = parameter_layouts_[i].shape(); in ComputeProgramShape()
63 *program_shape.add_parameter_names() = absl::StrCat("p", i); in ComputeProgramShape()
65 *program_shape.mutable_result() = result_layout_.shape(); in ComputeProgramShape()
66 return program_shape; in ComputeProgramShape()
Dlocal_service.cc99 const ProgramShape* program_shape) { in CreateExecutionOptions() argument
108 Shape result_shape(program_shape->result()); in CreateExecutionOptions()
125 ProgramShape program_shape(proto.host_program_shape()); in CompileExecutable() local
128 if (argument_layouts.size() != program_shape.parameters_size()) { in CompileExecutable()
131 program_shape.parameters_size(), argument_layouts.size()); in CompileExecutable()
138 if (!ShapeUtil::Compatible(argument_shape, program_shape.parameters(i))) { in CompileExecutable()
155 ShapeUtil::HumanString(program_shape.parameters(i)), in CompileExecutable()
161 program_shape.result())); in CompileExecutable()
165 CreateExecutionOptions(build_options, &program_shape); in CompileExecutable()
169 CreateModuleConfig(program_shape, argument_layouts, &execution_options)); in CompileExecutable()
Dhlo_module_config.cc31 HloModuleConfig::HloModuleConfig(const ProgramShape& program_shape, in HloModuleConfig() argument
34 ComputationLayout(program_shape, ignore_layouts)) {} in HloModuleConfig()
37 const ProgramShape& program_shape) { in SetDefaultComputationLayout() argument
38 entry_computation_layout_ = ComputationLayout(program_shape); in SetDefaultComputationLayout()
Dhlo_module_config.h45 explicit HloModuleConfig(const ProgramShape& program_shape,
55 void SetDefaultComputationLayout(const ProgramShape& program_shape);
Dhlo_proto_util.cc62 const auto& program_shape = hlo_proto.hlo_module().host_program_shape(); in EntryComputationParameterShapes() local
63 for (const ShapeProto& shape : program_shape.parameters()) { in EntryComputationParameterShapes()
Dservice.cc265 const ProgramShape& program_shape, in CreateModuleConfig() argument
268 auto config = absl::make_unique<HloModuleConfig>(program_shape); in CreateModuleConfig()
271 if (program_shape.parameters_size() != argument_shapes.size()) { in CreateModuleConfig()
273 program_shape.parameters_size(), in CreateModuleConfig()
280 program_shape.parameters(i))) { in CreateModuleConfig()
284 i, ShapeUtil::HumanString(program_shape.parameters(i)), in CreateModuleConfig()
296 ValidateResultShape(shape_with_output_layout, program_shape.result())); in CreateModuleConfig()
336 const ProgramShape& program_shape, in CreateModuleConfig() argument
343 return CreateModuleConfig(program_shape, argument_shapes, &execution_options); in CreateModuleConfig()
1086 ProgramShape program_shape(arg->computation().host_program_shape()); in ComputeConstantGraph() local
[all …]
/external/tensorflow/tensorflow/compiler/tf2xla/
Dxla_jit_compiled_cpu_function.cc90 TF_ASSIGN_OR_RETURN(std::unique_ptr<xla::ProgramShape> program_shape, in Compile()
92 if (program_shape->result().element_type() != xla::TUPLE) { in Compile()
101 program_shape->clear_parameter_names(); in Compile()
105 arg_shapes.reserve(program_shape->parameters_size()); in Compile()
106 for (int i = 0; i < program_shape->parameters_size(); ++i) { in Compile()
107 arg_shapes.push_back(&program_shape->parameters(i)); in Compile()
137 absl::make_unique<xla::ProgramShapeProto>(program_shape->ToProto()); in Compile()
Dxla_jit_compiled_cpu_function_test.cc120 const xla::ProgramShape program_shape(*function.ProgramShape()); in TEST() local
121 ASSERT_EQ(program_shape.parameters_size(), 2); in TEST()
122 EXPECT_TRUE(ShapeUtil::Compatible(program_shape.parameters(0), s32)); in TEST()
123 EXPECT_TRUE(ShapeUtil::Compatible(program_shape.parameters(1), s32)); in TEST()
125 const xla::Shape& result = program_shape.result(); in TEST()
Dxla_compiled_cpu_function.h297 StaticData* static_data, const xla::ProgramShapeProto* program_shape) { in set_static_data_program_shape() argument
298 static_data->program_shape_ = program_shape; in set_static_data_program_shape()
/external/tensorflow/tensorflow/compiler/xla/python/
Dxrt.cc154 ProgramShape program_shape; in CompileForXrt() local
156 *program_shape.add_parameters() = shape; in CompileForXrt()
158 *program_shape.mutable_result() = result_shape; in CompileForXrt()
160 LayoutUtil::SetToDefaultLayout(&program_shape); in CompileForXrt()
161 *config->mutable_program_shape() = program_shape.ToProto(); in CompileForXrt()
174 return new XrtExecutable(program_shape, handle, session_target); in CompileForXrt()
177 XrtExecutable::XrtExecutable(const ProgramShape& program_shape, int64 handle, in XrtExecutable() argument
179 : program_shape_(program_shape), in XrtExecutable()
207 const int num_expected_arguments = program_shape().parameters().size(); in Execute()
241 return new XrtAllocation(output, program_shape().result(), session_target_); in Execute()
[all …]
Dxrt.h93 XrtExecutable(const ProgramShape& program_shape, int64 handle,
102 const ProgramShape& program_shape() const;
/external/tensorflow/tensorflow/compiler/xla/tools/
Ddumped_computation_to_text.cc53 std::unique_ptr<ProgramShape> program_shape = in RealMain() local
57 layouts.reserve(program_shape->parameters_size()); in RealMain()
58 for (int i = 0; i < program_shape->parameters_size(); ++i) { in RealMain()
59 layouts.push_back(&program_shape->parameters(i)); in RealMain()
64 build_options.set_result_layout(program_shape->result()); in RealMain()
Ddumped_computation_to_operation_list.cc77 std::unique_ptr<ProgramShape> program_shape = in RealMain() local
81 layouts.reserve(program_shape->parameters_size()); in RealMain()
82 for (int i = 0; i < program_shape->parameters_size(); ++i) { in RealMain()
83 layouts.push_back(&program_shape->parameters(i)); in RealMain()
87 build_options.set_result_layout(program_shape->result()); in RealMain()
/external/tensorflow/tensorflow/compiler/xrt/kernels/
Dxrt_compile_ops.cc115 config.program_shape().parameters_size()); in Compile()
117 config.program_shape().parameters_size()); in Compile()
118 for (int i = 0; i < config.program_shape().parameters_size(); ++i) { in Compile()
119 argument_layouts[i] = xla::Shape(config.program_shape().parameters(i)); in Compile()
124 build_options.set_result_layout(xla::Shape(config.program_shape().result())); in Compile()
187 xla::ProgramShapeProto program_shape = executable->executable() in Compute() local
194 program_shape_output.vec<string>()(0) = program_shape.SerializeAsString(); in Compute()
/external/tensorflow/tensorflow/compiler/xrt/tests/
Draw_api_test.cc729 TF_EXPECT_OK(session.Run({read_back, c_handle.program_shape}, &outputs)); in TEST()
737 xla::ProgramShapeProto program_shape; in TEST() local
738 EXPECT_TRUE(program_shape.ParseFromString(outputs[1].vec<string>()(0))); in TEST()
739 EXPECT_EQ(program_shape.parameters_size(), 2); in TEST()
784 TF_EXPECT_OK(session.Run({read_back, c_handle.program_shape}, &outputs)); in TEST()
792 xla::ProgramShapeProto program_shape; in TEST() local
793 EXPECT_TRUE(program_shape.ParseFromString(outputs[1].vec<string>()(0))); in TEST()
794 EXPECT_EQ(program_shape.parameters_size(), 2); in TEST()
835 {c_handle.program_shape}, {release}, &outputs)); in TEST()
839 xla::ProgramShape program_shape(program_shape_proto); in TEST() local
[all …]
/external/tensorflow/tensorflow/compiler/xla/tests/
Dhlo_test_base.cc76 ProgramShape program_shape; in GetProgramShapeWithLayout() local
79 *program_shape.add_parameters() = param->shape(); in GetProgramShapeWithLayout()
80 *program_shape.add_parameter_names() = param->name(); in GetProgramShapeWithLayout()
82 *program_shape.mutable_result() = entry->root_instruction()->shape(); in GetProgramShapeWithLayout()
83 return program_shape; in GetProgramShapeWithLayout()
238 const auto& program_shape = GetProgramShapeWithLayout(test_module); in MakeReferenceModule() local
242 if (!ProgramShapesEqual(program_shape, in MakeReferenceModule()
/external/tensorflow/tensorflow/compiler/aot/
Dcodegen.cc396 const xla::ProgramShapeProto& ps = compile_result.program_shape; in GenerateHeader()
694 std::unique_ptr<xla::ProgramShapeProto> program_shape; in GenerateMetadata() local
697 program_shape = in GenerateMetadata()
698 absl::make_unique<xla::ProgramShapeProto>(compile_result.program_shape); in GenerateMetadata()
703 program_shape->clear_parameter_names(); in GenerateMetadata()
711 "xla::ProgramShapeProto", program_shape.get()}; in GenerateMetadata()
Dcompile.cc59 compile_result->program_shape = pshape_or.ValueOrDie()->ToProto(); in CompileXla()
60 xla::ProgramShapeProto* pshape = &compile_result->program_shape; in CompileXla()
Dcompile.h36 xla::ProgramShapeProto program_shape; // Static shape of args and results. member
/external/tensorflow/tensorflow/compiler/xla/client/lib/
Dtesting.cc102 auto program_shape = computation.proto().host_program_shape(); in MakeFakeArgumentsOrDie() local
105 for (const ShapeProto& shape : program_shape.parameters()) { in MakeFakeArgumentsOrDie()

12